In [20]:
import os.path
import rmgpy
from rmgpy.data.rmg import RMGDatabase
from rmgpy.chemkin import loadSpeciesDictionary
from rmgpy.molecule.resonance import generateAromaticResonanceIsomers
from rmgpy.molecule.molecule import Molecule
In [2]:
temperature = 298
In [3]:
databasePath = rmgpy.settings['database.directory']
database1 = RMGDatabase()
database1.load(
path = databasePath,
thermoLibraries = [],
reactionLibraries = [],
seedMechanisms = [],
kineticsFamilies = 'none'
)
database2 = RMGDatabase()
database2.load(
path = databasePath,
thermoLibraries = ['PAHLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsFamilies = 'none'
)
In [4]:
speciesList1 = loadSpeciesDictionary('/home/mjliu/Documents/PAHThermo/species_dictionary.txt')
speciesList2 = loadSpeciesDictionary('/home/mjliu/Documents/PAHThermo/species_dictionary.txt')
In [5]:
for label, spec in speciesList1.iteritems():
#amol = generateAromaticResonanceIsomers(spec.molecule[0])
print spec.molecule[0]
spec.thermo = database1.thermo.estimateThermoViaGroupAdditivity(spec.molecule[0])
#spec.thermo = database1.thermo.getThermoData(spec)
spec.h = spec.thermo.getEnthalpy(temperature) / 1000
spec.s = spec.thermo.getEntropy(temperature)
In [6]:
#for label, spec in speciesList1.iteritems():
# print label + ' : ' + str(len(spec.molecule))
In [7]:
for label, spec in speciesList2.iteritems():
spec.thermo = database2.thermo.getThermoData(spec)
spec.h = spec.thermo.getEnthalpy(temperature) / 1000
spec.s = spec.thermo.getEntropy(temperature)
In [8]:
labels = []
gavEnthalpy = []
gavEntropy = []
calcEnthalpy = []
calcEntropy = []
for label in speciesList1.keys():
labels.append(label)
gavEnthalpy.append(speciesList1[label].h)
gavEntropy.append(speciesList1[label].s)
calcEnthalpy.append(speciesList2[label].h)
calcEntropy.append(speciesList2[label].s)
In [9]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
In [10]:
plt.plot(gavEnthalpy, calcEnthalpy, 'bo')
plt.plot([0, 800], [0, 800], 'k--')
plt.xlabel('Group Additivity')
plt.ylabel('Calculated G3(MP2)//B3')
plt.show()
In [11]:
plt.plot(gavEntropy, calcEntropy, 'bo')
plt.plot([0, 500], [0, 500], 'k--')
plt.xlabel('Group Additivity')
plt.ylabel('Calculated G3(MP2)//B3')
plt.show()
In [12]:
hDiff = np.subtract(calcEnthalpy,gavEnthalpy)
plt.plot(np.sort(hDiff),'bo')
plt.show()
In [24]:
rings = []
for label in labels:
SSSR = speciesList1[label].molecule[0].getSmallestSetOfSmallestRings()
rings.append(len(SSSR))
print zip(labels, rings)
In [46]:
print labels
In [47]:
sextets = [2,2,1,1,1,1,2,2,1,1,1,1,1,2,1,2,1,1,1,2,2,1,1,1,1,1,1,1,2,1,1,1,2,2,1,1,1,1,2,1,2,2,1,1]
dbonds = [3,1,6,0,0,0,2,1,0,2,2,2,0,1,2,4,0,2,2,1,0,0,2,2,2,2,2,2,2,0,2,2,1,0,2,0,2,2,1,0,2,1,4,0]
In [68]:
plt.plot(np.multiply(benzsextet,6.)+np.multiply(benzdbonds,2.),benz,'bo')
plt.plot(np.multiply(cpdlsextet,6.)+np.multiply(cpdldbonds,2.),cpdl,'ro')
plt.show()
In [40]:
plt.plot(rings,hDiff,'bo')
plt.show()
In [57]:
benz = []
benzring = []
benzsextet = []
benzdbonds = []
cpdl = []
cpdlring = []
cpdlsextet = []
cpdldbonds = []
rbenz = []
rbenzring = []
rbenzsextet = []
rbenzdbonds = []
rcpdl = []
rcpdlring = []
rcpdlsextet = []
rcpdldbonds = []
for index, label in enumerate(labels):
if 'R5' in label:
if '-' in label:
rcpdl.append(hDiff[index])
rcpdlring.append(rings[index])
rcpdlsextet.append(sextets[index])
rcpdldbonds.append(dbonds[index])
else:
cpdl.append(hDiff[index])
cpdlring.append(rings[index])
cpdlsextet.append(sextets[index])
cpdldbonds.append(dbonds[index])
elif '-' in label:
rbenz.append(hDiff[index])
rbenzring.append(rings[index])
rbenzsextet.append(sextets[index])
rbenzdbonds.append(dbonds[index])
else:
benz.append(hDiff[index])
benzring.append(rings[index])
benzsextet.append(sextets[index])
benzdbonds.append(dbonds[index])
In [56]:
plt.plot(benzring,benz,'bo')
plt.plot(cpdlring,cpdl,'ro')
plt.plot(rbenzring,rbenz,'bs')
plt.plot(rcpdlring,rcpdl,'rs')
plt.show()
In [14]:
np.mean(np.absolute(np.subtract(calcEnthalpy,gavEnthalpy)))
Out[14]:
In [15]:
sDiff = np.subtract(calcEntropy,gavEntropy)
plt.plot(np.sort(sDiff),'bo')
plt.show()
In [37]:
benzs = []
cpdls = []
rbenzs = []
rcpdls = []
for index, label in enumerate(labels):
if 'R5' in label:
if '-' in label:
rcpdls.append(sDiff[index])
else:
cpdls.append(sDiff[index])
elif '-' in label:
rbenzs.append(sDiff[index])
else:
benzs.append(sDiff[index])
In [41]:
plt.plot(benzring,benzs,'bo')
plt.plot(cpdlring,cpdls,'ro')
#plt.plot(rbenzring,rbenz,'bs')
#plt.plot(rcpdlring,rcpdl,'rs')
plt.show()
In [ ]: