Figure 4.12:

Two first-order reactions in parallel in a batch reactor.

Figure 4.12

Code for Figure 4.12

Text of the GNU GPL.

main.py


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

npts = 100
x = np.linspace(0, 3, npts)
y = np.column_stack([
    np.exp(-3*x),
    (1 - np.exp(-3*x))/3.0,
    2*(1 - np.exp(-3*x))/3.0
])
table = np.column_stack([x, y])
save_ascii('parallel.dat', table)