5def exact_sol_coag(kernel, x, tau):
7 Function to compute exact solution of the Smoluchowski equation for simple kernel (constant and additive)
11 kernel : scalar, type -> integer
12 select the collisional kernel function
13 x : scalar or 1D array, type -> float
14 mass value to evaluate the solution
15 tau : scalar, type -> float
16 time to evaluate the solution
21 res : scalar or 1D array, type -> float
22 exact solution evaluated at x and tau
33 res = 4.0 * x / ((2.0 + tau) ** 2) * mp.exp(-(1.0 - tau / (2.0 + tau)) * x)
37 res = [x[i] * mp.exp(-x[i])
for i
in range(np.size(x))]
40 4.0 * x[i] / ((2.0 + tau) ** 2) * mp.exp(-(1.0 - tau / (2.0 + tau)) * x[i])
41 for i
in range(np.size(x))
54 res = ((1 - T) * mp.exp(-x * (T + 1)) * mp.besseli(1, 2 * x * mp.sqrt(T))) / (
60 res = [x[i] * mp.exp(-x[i])
for i
in range(np.size(x))]
64 ((1 - T) * mp.exp(-x[i] * (T + 1)) * mp.besseli(1, 2 * x[i] * mp.sqrt(T)))
66 for i
in range(np.size(x))
72 raise ValueError(
"Need to choose a kernel with analytic solution.")