Figure 8.14:

Comparison of the effluent concentrations for the two cases shown in Figure~\ref {fig:pc_cp_schem}.

Figure 8.14

Code for Figure 8.14

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
# Converted from pc_cp_comp.m - compare PFR-CSTR vs CSTR-PFR ordering
import numpy as np
from misc import save_ascii

ktheta = np.linspace(0.1, 10., 100)

def C_func(x, ktheta):
    return (-1. + np.sqrt(1.+4.*x*ktheta)) / (2.*ktheta)

def P_func(x, ktheta):
    return x / (1.+x*ktheta)

c0 = 1.
cp = P_func(C_func(c0, ktheta), ktheta)
pc = C_func(P_func(c0, ktheta), ktheta)
table = np.vstack([[0., c0, c0],
                   np.column_stack([ktheta, cp, pc])])
save_ascii('pc_cp_comp.dat', table)