Figure 9.19:

Uncertainty in activation energy E and rate constant \ln k_m versus next measurement temperature.

Figure 9.19

Code for Figure 9.19

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
# Converted from nextTb.m - optimal next temperature (sweep over T)
import numpy as np
from misc import save_ascii

chisq  = 5.99
Tmin   = 300.0
Tmax   = 500.0
nTvals = 51
n0     = 1
T0     = np.concatenate([np.full(n0, Tmin), np.full(n0, Tmax)])
S      = np.eye(2)
Trep   = 1.0 / np.linspace(1.0/Tmin, 1.0/Tmax, nTvals)
meanT  = 1.0 / (0.5*(1.0/Tmin + 1.0/Tmax))
intun  = np.zeros(nTvals)
slopeun = np.zeros(nTvals)

for i, Ti in enumerate(Trep):
    Tmeas   = np.concatenate([T0, [Ti]])
    ndata   = len(Tmeas)
    Tcenter = -1.0/Tmeas + 1.0/meanT
    X       = np.column_stack([np.ones(ndata), Tcenter])
    measvar = 1e-3
    amat    = S @ X.T @ X @ S / measvar
    level   = chisq
    inva    = np.linalg.inv(amat)
    intun[i]    = np.sqrt(level * inva[0, 0])
    slopeun[i]  = np.sqrt(level * inva[1, 1])

table = np.column_stack([Trep, intun, slopeun])
save_ascii('nextTb.dat', table)