@@ -4,13 +4,35 @@ function nonLinChem(dy,y,p,t)
44 dy[3 ] = (y[2 ])^ 2
55end
66y0 = [1.0 ;0.0 ;0.0 ]
7- tspan = (0.0 ,20 )
7+ tspan = (0.0 ,20.0 )
88nlc_analytic (u0,p,t) = [exp (- t);
99 (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))));
1010 - 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))))]
1111nonLinChem_f = ODEFunction (nonLinChem,analytic = nlc_analytic)
1212
1313"""
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.
1537"""
1638prob_ode_nonlinchem = ODEProblem (nonLinChem,y0,tspan)
0 commit comments