Figure 5.5:

Comparison of measured and calculated rate constant versus temperature for trioxane decomposition.

Figure 5.5

Code for Figure 5.5

Text of the GNU GPL.

main.py


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Converted from trioxane.m
import numpy as np
from misc import save_ascii

R1 = 1.987   # cal/mol/K
R  = 8.314   # J/mol/K
kb = 1.381e-23  # J/K
h  = 6.626e-34  # J*s
c  = 2.998e10   # cm/s

T = np.linspace(700, 800, 11)

nucompl = np.array([100, 100, 200, 200, 945, 945, 1400, 1400,
                    1178, 1178, 1200, 1200, 1200, 1200, 1481,
                    1481, 2850, 2850, 3025, 3025, 1000, 1242,
                    1100, 200, 700, 1200, 1495, 2850, 3025], dtype=float)

nuoxir = np.array([296, 296, 524, 524, 945, 945, 1070, 1070,
                   1178, 1178, 1305, 1305, 1410, 1410, 1481,
                   1481, 2850, 2850, 3025, 3025, 1122, 1242,
                   1383, 466, 752, 978, 1235, 1495, 2850, 3025], dtype=float)

E = 51400.   # cal/mol
IaIbIc_compl = 125.3 * 120.5 * 249.2
IaIbIc_oxir  = 96.4  * 96.4  * 173.0
qrot_ratio = IaIbIc_compl**0.5 / IaIbIc_oxir**0.5

freq = kb * T / h
hc   = h * c / (kb * T)  # shape (11,)

# qvib arrays: shape (29 or 30, 11)
qvibcompl = np.exp(-0.5 * np.outer(nucompl, hc)) / (1 - np.exp(-np.outer(nucompl, hc)))
qviboxir  = np.exp(-0.5 * np.outer(nuoxir,  hc)) / (1 - np.exp(-np.outer(nuoxir,  hc)))

prodcompl = np.prod(qvibcompl, axis=0)
prodoxir  = np.prod(qviboxir,  axis=0)
qvib = prodcompl / prodoxir

qe = np.exp(-E / (R1 * T))
k_rate = freq * qrot_ratio * qe * qvib
kexp = 10**15.28 * np.exp(-47500. / (R1 * T))
kup  = 10**(15.28 + 0.06) * np.exp(-(47500 - 2.4) / (R1 * T))
klow = 10**(15.28 - 0.06) * np.exp(-(47500 + 2.4) / (R1 * T))

table = np.column_stack([1000. / T, k_rate, kexp, kup, klow])
save_ascii('trioxane.dat', table)