Figure 8.9:

P(\theta ) versus \theta for n CSTRs in series, \tau =2.

Figure 8.9

Code for Figure 8.9

Text of the GNU GPL.

main.py


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Converted from ncstrsP.m - CDF for n CSTRs in series
import numpy as np
from scipy.special import gammainc
from misc import save_ascii

x   = np.linspace(0., 5., 200)
tau = 2.
ns  = [1, 2, 3, 5, 10, 25, 100]
P   = np.zeros((len(x), len(ns)))

for i, n in enumerate(ns):
    P[:,i] = gammainc(n, n/tau*x)

Ptable = np.column_stack([x, P])
save_ascii('ncstrsP.dat', Ptable)