@@ -4,13 +4,35 @@ function nonLinChem(dy,y,p,t)
4
4
dy[3 ] = (y[2 ])^ 2
5
5
end
6
6
y0 = [1.0 ;0.0 ;0.0 ]
7
- tspan = (0.0 ,20 )
7
+ tspan = (0.0 ,20.0 )
8
8
nlc_analytic (u0,p,t) = [exp (- t);
9
9
(2 sqrt (exp (- t))besselk (1 ,2 sqrt (exp (- t)))- 2 besselk (1 ,2 )/ besseli (1 ,2 )* sqrt (exp (- t))besseli (1 ,2 sqrt (exp (- t))))/ (2 besselk (0 ,2 sqrt (exp (- t)))+ (2 besselk (1 ,2 )/ besseli (1 ,2 ))besseli (0 ,2 sqrt (exp (- t))));
10
10
- exp (- t)+ 1 + (- 2 sqrt (exp (- t))* besselk (1 ,2 sqrt (exp (- t)))+ sqrt (exp (- t))* besseli (1 ,2 sqrt (exp (- t)))* 2 besselk (1 ,2 )/ besseli (1 ,2 ))/ (2 besselk (0 ,2 sqrt (exp (- t)))+ 2 besselk (1 ,2 )/ besseli (1 ,2 )* besseli (0 ,2 sqrt (exp (- t))))]
11
11
nonLinChem_f = ODEFunction (nonLinChem,analytic = nlc_analytic)
12
12
13
13
"""
14
- TODO: Insert Problem Description here.
14
+ Nonlinear system of reactions with an analytical solution
15
+
16
+ ```math
17
+ \f rac{dy_1}{dt} = -y_1
18
+ ```
19
+
20
+ ```math
21
+ \f rac{dy_2}{dt} = y_1 - y_2^2
22
+ ```
23
+
24
+ ```math
25
+ \f rac{dy_3}{dt} = y_2^2
26
+ ```
27
+
28
+ with initial condition ``y=[1;0;0]`` on a time span of ``t \i n (0,20)``
29
+
30
+ From
31
+
32
+ Liu, L. C., Tian, B., Xue, Y. S., Wang, M., & Liu, W. J. (2012). Analytic solution
33
+ for a nonlinear chemistry system of ordinary differential equations. Nonlinear
34
+ Dynamics, 68(1-2), 17-21.
35
+
36
+ The analytical solution is implemented, allowing easy testing of ODE solvers.
15
37
"""
16
38
prob_ode_nonlinchem = ODEProblem (nonLinChem,y0,tspan)
0 commit comments