Figure 8.10:

P(\theta ) versus \theta for plug flow with dispersion number D, \tau =2.

Figure 8.10

Code for Figure 8.10

Text of the GNU GPL.

main.py


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Converted from dispersionP.m - dispersion model CDF P(t)
import numpy as np
from scipy.special import erf
from misc import save_ascii

x   = np.linspace(0., 5., 200)
tau = 2.
Ds  = [0.002, 0.01, 0.05, 0.2]
P   = np.zeros((len(x), len(Ds)))

for i, D in enumerate(Ds):
    arg    = (1. - x/tau) / np.sqrt(x/tau) / np.sqrt(4.*D)
    P[:,i] = 0.5*(1. - erf(arg))

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