In [ ]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from rmgpy.chemkin import readThermoEntry
In [ ]:
# NASA polynomials
data = [
"""S(16662) H 8C 12 G 100.000 5000.000 1048.84 1
1.72305567E+01 4.27330689E-02-1.86066312E-05 3.65472188E-09-2.66190366E-13 2
1.74743699E+04-6.77110252E+01 3.34031214E-01 6.05669789E-02 2.25406696E-05 3
-6.48654752E-08 2.61645367E-11 2.35821360E+04 2.68309196E+01 4
""",
"""S(14876) H 10C 14 G 100.000 5000.000 987.00 1
2.24758673E+01 4.51466886E-02-1.71295179E-05 3.25529909E-09-2.38522805E-13 2
1.41347653E+04-1.02120795E+02-4.98473374E-01 7.10259377E-02 4.57103844E-05 3
-1.08199644E-07 4.54717625E-11 2.19445266E+04 2.50052046E+01 4
"""
]
labels = [
'Acenaphtylene',
'Phenanthrene',
]
In [ ]:
thermo = []
for entry in data:
thermo.append(readThermoEntry(entry)[1])
In [ ]:
tlist = np.linspace(300, 3000, 100)
Cpall = []
Hall = []
Sall = []
Gall = []
for entry in thermo:
Cplist = np.zeros_like(tlist)
Hlist = np.zeros_like(tlist)
Slist = np.zeros_like(tlist)
Glist = np.zeros_like(tlist)
for i, t in enumerate(tlist):
Cplist[i] = entry.getHeatCapacity(t) / 4.184
Hlist[i] = entry.getEnthalpy(t) / 4184
Slist[i] = entry.getEntropy(t) / 4.184
Glist[i] = entry.getFreeEnergy(t) / 4184
Cpall.append(Cplist)
Hall.append(Hlist)
Sall.append(Slist)
Gall.append(Glist)
In [ ]:
for item, label in zip(Cpall, labels):
plt.plot(tlist, item, label=label)
plt.xlabel('Temperature (K)')
plt.ylabel('Heat Capacity (cal/mol-K)')
plt.legend(loc=4)
plt.show()
In [ ]:
for item, label in zip(Hall, labels):
plt.plot(tlist, item, label=label)
plt.xlabel('Temperature (K)')
plt.ylabel('Enthalpy (kcal/mol-K)')
plt.legend(loc=2)
plt.show()
In [ ]:
for item, label in zip(Sall, labels):
plt.plot(tlist, item, label=label)
plt.xlabel('Temperature (K)')
plt.ylabel('Entropy (cal/mol-K)')
plt.legend(loc=4)
plt.show()
In [ ]:
for item, label in zip(Gall, labels):
plt.plot(tlist, item, label=label)
plt.xlabel('Temperature (K)')
plt.ylabel('Free Energy (kcal/mol-K)')
plt.legend(loc=3)
plt.show()
In [ ]: