Skip to content

Commit e96b012

Browse files
rwestssun30
authored andcommitted
Consistently use T=298. K for fitting and evaluating Blowers-Masel rates.
Closes #1748
1 parent 71662f1 commit e96b012

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

rmgpy/data/kinetics/family.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3658,13 +3658,13 @@ def cross_validate(self, folds=5, template_rxn_map=None, test_rxn_inds=None, T=1
36583658
if kinetics.E0.value_si < 0.0 or len(L) == 1:
36593659
kinetics = average_kinetics([r.kinetics for r in L])
36603660
else:
3661-
kinetics = kinetics.to_arrhenius(rxn.get_enthalpy_of_reaction(298.0))
3661+
kinetics = kinetics.to_arrhenius(rxn.get_enthalpy_of_reaction(298.))
36623662
else:
36633663
kinetics = ArrheniusChargeTransferBM().fit_to_reactions(L, recipe=self.forward_recipe.actions)
36643664
if kinetics.E0.value_si < 0.0 or len(L) == 1:
36653665
kinetics = average_kinetics([r.kinetics for r in L])
36663666
else:
3667-
kinetics = kinetics.to_arrhenius_charge_transfer(rxn.get_enthalpy_of_reaction(298.0))
3667+
kinetics = kinetics.to_arrhenius_charge_transfer(rxn.get_enthalpy_of_reaction(298.))
36683668

36693669
k = kinetics.get_rate_coefficient(T)
36703670
errors[rxn] = np.log(k / krxn)
@@ -4596,15 +4596,15 @@ def _make_rule(rr):
45964596
dlnks = np.array([
45974597
np.log(
45984598
arr().fit_to_reactions(rs[list(set(range(len(rs))) - {i})], recipe=recipe)
4599-
.to_arrhenius(rxn.get_enthalpy_of_reaction(Tref))
4599+
.to_arrhenius(rxn.get_enthalpy_of_reaction(298.))
46004600
.get_rate_coefficient(T=Tref) / rxn.get_rate_coefficient(T=Tref)
46014601
) for i, rxn in enumerate(rs)
46024602
]) # 1) fit to set of reactions without the current reaction (k) 2) compute log(kfit/kactual) at Tref
46034603
else: # SurfaceChargeTransfer or ArrheniusChargeTransfer
46044604
dlnks = np.array([
46054605
np.log(
46064606
arr().fit_to_reactions(rs[list(set(range(len(rs))) - {i})], recipe=recipe)
4607-
.to_arrhenius_charge_transfer(rxn.get_enthalpy_of_reaction(Tref))
4607+
.to_arrhenius_charge_transfer(rxn.get_enthalpy_of_reaction(298.))
46084608
.get_rate_coefficient(T=Tref) / rxn.get_rate_coefficient(T=Tref)
46094609
) for i, rxn in enumerate(rs)
46104610
]) # 1) fit to set of reactions without the current reaction (k) 2) compute log(kfit/kactual) at Tref

rmgpy/kinetics/arrhenius.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ cdef class ArrheniusBM(KineticsModel):
559559
"""
560560
Return the rate coefficient in the appropriate combination of m^3,
561561
mol, and s at temperature `T` in K and enthalpy of reaction `dHrxn`
562-
in J/mol.
562+
in J/mol, evaluated at 298 K.
563563
"""
564564
cdef double A, n, Ea
565565
Ea = self.get_activation_energy(dHrxn)
@@ -570,7 +570,7 @@ cdef class ArrheniusBM(KineticsModel):
570570
cpdef double get_activation_energy(self, double dHrxn) except -1:
571571
"""
572572
Return the activation energy in J/mol corresponding to the given
573-
enthalpy of reaction `dHrxn` in J/mol.
573+
enthalpy of reaction `dHrxn` in J/mol, evaluated at 298 K.
574574
"""
575575
cdef double w0, E0
576576
E0 = self._E0.value_si
@@ -586,7 +586,8 @@ cdef class ArrheniusBM(KineticsModel):
586586
cpdef Arrhenius to_arrhenius(self, double dHrxn):
587587
"""
588588
Return an :class:`Arrhenius` instance of the kinetics model using the
589-
given enthalpy of reaction `dHrxn` to determine the activation energy.
589+
given enthalpy of reaction `dHrxn` (in J/mol, evaluated at 298 K)
590+
to determine the activation energy.
590591
"""
591592
return Arrhenius(
592593
A=self.A,
@@ -615,7 +616,6 @@ cdef class ArrheniusBM(KineticsModel):
615616
w0 = sum(w0s) / len(w0s)
616617

617618
if len(rxns) == 1:
618-
T = 1000.0
619619
rxn = rxns[0]
620620
dHrxn = rxn.get_enthalpy_of_reaction(298.0)
621621
A = rxn.kinetics.A.value_si
@@ -632,7 +632,7 @@ cdef class ArrheniusBM(KineticsModel):
632632
self.Tmin = rxn.kinetics.Tmin
633633
self.Tmax = rxn.kinetics.Tmax
634634
self.solute = None
635-
self.comment = 'Fitted to {0} reaction at temperature: {1} K'.format(len(rxns), T)
635+
self.comment = 'Fitted to 1 reaction.'
636636
else:
637637
# define optimization function
638638
def kfcn(xs, lnA, n, E0):

0 commit comments

Comments
 (0)