Figure 4.8:

Batch reactor with nth-order kinetics, r=kc_A^n, k_0=kc_{A0}^{n-1}=1, n\geq 1.

Figure 4.8

Code for Figure 4.8

Text of the GNU GPL.

main.py


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Converted from kcan.m
import numpy as np
from misc import save_ascii

npts = 100
x = np.linspace(0, 5, npts)
y = np.column_stack([
    np.exp(-x),
    1.0/(1.0 + x),
    (1.0 + 2*x)**(-0.5),
    (1.0 + 3*x)**(-1.0/3),
    (1.0 + 4*x)**(-0.25)
])
table = np.column_stack([x, y])
save_ascii('kcan.dat', table)