-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Describe the solution you'd like
MKM packages such as chemkin and Cantera uses modified Arrhenius equation which looks like:
k = A*T^(b)*e^(-Ea/RT)
Typically, we run isothermal reactor, so We simply use b = 0, and use A and Ea that would reproduce the transition state theory calculated k at the reactor temperature. This is okay for the isothermal reactor, but for those of who running the nonisothermal reactor needs to nail down the A, b and Ea values well for the correct simulation. It would be nice to have a function from pmutt.reaction.Reaction that fit these values correctly.
Describe alternatives you've considered
Currently, I had to write my own function to fit A, b, and Ea. I calculated Ea first by
rxn.get_E_state('transition_state','eV',include_ZPE=True) - rxn.get_E_state('reactants','eV',include_ZPE=True)
Be aware that you should not use get_E_act, here because it actually calculates get_H_act. (It doesn't make sense anyway that get_E_act needs T. Perhaps we need to differentiate it with get_U_act).
After this, I calculate a line of A values:
Ts = np.linspace(85, 800, 500)
As = [rxn.get_A(T) for T in Ts]
and I have written least-square fitting function to fit A*T^b:
def axb_fitting(x,y):
n = len(x)
# Finding required sum for least square methods
sumX,sumX2,sumY,sumXY = 0,0,0,0
for i in range(n):
sumX = sumX + np.log(x[i])
sumX2 = sumX2 +np.log(x[i])*np.log(x[i])
sumY = sumY + np.log(y[i])
sumXY = sumXY + np.log(x[i])*np.log(y[i])
# Finding coefficients A and B
b = (n*sumXY-sumX*sumY)/(n*sumX2-sumX*sumX)
A = (sumY - b*sumX)/n
# Obtaining a and b
a = np.exp(A)
return a,b
I hope this is implemented in the future, and also the difference between E and U should be solved.