@@ -7,14 +7,14 @@ function lotka(du, u, p, t)
77 du[2 ] = - p[3 ] * y + p[4 ] * x * y
88end
99
10- """
10+ @doc doc """
1111Lotka-Volterra Equations (Non-stiff)
1212
1313```math
14- \\ frac{dx}{dt} = ax - bxy
14+ \f rac{dx}{dt} = ax - bxy
1515```
1616```math
17- \\ frac{dy}{dt} = -cy + dxy
17+ \f rac{dy}{dt} = -cy + dxy
1818```
1919
2020with initial condition ``x=y=1``
@@ -33,14 +33,14 @@ function fitz(du, u, p, t)
3333 du[1 ] = v - v^ 3 / 3 - w + l
3434 du[2 ] = τinv * (v + a - b * w)
3535end
36- """
36+ @doc doc """
3737Fitzhugh-Nagumo (Non-stiff)
3838
3939```math
40- \\ frac{dv}{dt} = v - \ \ frac{v^3}{3} - w + I_{est}
40+ \f rac{dv}{dt} = v - \f rac{v^3}{3} - w + I_{est}
4141```
4242```math
43- τ \\ frac{dw}{dt} = v + a -bw
43+ τ \f rac{dw}{dt} = v + a -bw
4444```
4545
4646with initial condition ``v=w=1``
@@ -68,34 +68,34 @@ function vanderpol_jac(J, u, p, t)
6868 J[2 ,2 ] = μ * (1 - x^ 2 )
6969end
7070
71- """
71+ @doc doc """
7272Van der Pol Equations
7373
7474```math
75- \\ frac{dx}{dt} = y
75+ \f rac{dx}{dt} = y
7676```
7777```math
78- \\ frac{dy}{dt} = μ((1-x^2)y -x)
78+ \f rac{dy}{dt} = μ ((1-x^2)y - x)
7979```
8080
81- with ``μ=1.0`` and ``u_0=[\\ sqrt{3}, 0]`` (where ``u[1] = x``, ``u[2] = y``)
81+ with ``μ=1.0`` and ``u_0=[\s qrt{3}, 0]`` (where ``u[1] = x``, ``u[2] = y``)
8282
8383Non-stiff parameters.
8484"""
85- prob_ode_vanderpol = ODEProblem (ODEFunction (vanderpol, jac= vanderpol_jac),
85+ prob_ode_vanderpol = ODEProblem (ODEFunction (vanderpol, jac= vanderpol_jac),
8686 [sqrt (3 ), 0.0 ], (0.0 , 1.0 ), [1.0 ])
8787
88- """
88+ @doc doc """
8989Van der Pol Equations
9090
9191```math
92- \\ frac{dx}{dt} = y
92+ \f rac{dx}{dt} = y
9393```
9494```math
95- \\ frac{dy}{dt} = μ((1-x^2)y -x)
95+ \f rac{dy}{dt} = μ ((1-x^2)y - x)
9696```
9797
98- with ``μ=10^6`` and ``u_0=[\\ sqrt{3}, 0]`` (where ``u[1] = x``, ``u[2] = y``)
98+ with ``μ=10^6`` and ``u_0=[\s qrt{3}, 0]`` (where ``u[1] = x``, ``u[2] = y``)
9999
100100Stiff parameters.
101101"""
@@ -115,20 +115,20 @@ function rober(du, u, p, t)
115115 du[3 ] = k₂ * y₂^ 2
116116end
117117
118- """
118+ @doc doc """
119119The Robertson biochemical reactions: (Stiff)
120120
121121```math
122- \\ frac{dy₁}{dt} = -k₁y₁+k₃y₂y₃
122+ \f rac{dy₁}{dt} = -k₁y₁+k₃y₂y₃
123123```
124124```math
125- \\ frac{dy₂}{dt} = k₁y₁-k₂y₂^2-k₃y₂y₃
125+ \f rac{dy₂}{dt} = k₁y₁-k₂y₂^2-k₃y₂y₃
126126```
127127```math
128- \\ frac{dy₃}{dt} = k₂y₂^2
128+ \f rac{dy₃}{dt} = k₂y₂^2
129129```
130130
131- where ``k₁=0.04``, ``k₂=3\\ times10^7``, ``k₃=10^4``. For details, see:
131+ where ``k₁=0.04``, ``k₂=3\t imes10^7``, ``k₃=10^4``. For details, see:
132132
133133Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129
134134
@@ -202,17 +202,17 @@ function rigidbody(du, u, p, t)
202202 du[3 ] = I₃ * y₁ * y₂
203203end
204204
205- """
205+ @doc doc """
206206Rigid Body Equations (Non-stiff)
207207
208208```math
209- \\ frac{dy₁}{dt} = I₁y₂y₃
209+ \f rac{dy₁}{dt} = I₁y₂y₃
210210```
211211```math
212- \\ frac{dy₂}{dt} = I₂y₁y₃
212+ \f rac{dy₂}{dt} = I₂y₁y₃
213213```
214214```math
215- \\ frac{dy₃}{dt} = I₃y₁y₂
215+ \f rac{dy₃}{dt} = I₃y₁y₂
216216```
217217
218218with ``I₁=-2``, ``I₂=1.25``, and ``I₃=-1/2``.
@@ -240,7 +240,6 @@ pleiades = (du, u, p, t) -> begin
240240 du[i] = zero (eltype (u))
241241 end
242242 for i in 1 : 7 , j in 1 : 7
243-
244243 if i != j
245244 r = ((x[i] - x[j])^ 2 + (y[i] - y[j])^ 2 )^ (3 / 2 )
246245 du[14 + i] += j * (x[j] - x[i]) / r
@@ -376,7 +375,7 @@ prob_ode_mm_linear = ODEProblem(mm_f, rand(4), (0.0, 1.0))
376375function hires (du, u, p, t)
377376 y1, y2, y3, y4, y5, y6, y7, y8 = u
378377 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12 = p
379-
378+
380379 du[1 ] = - p1 * y1 + p2 * y2 + p3 * y3 + p4
381380 du[2 ] = p1 * y1 - p5 * y2
382381 du[3 ] = - p6 * y3 + p2 * y4 + p7 * y5
@@ -393,24 +392,24 @@ u0[8] = 0.0057
393392
394393p = (1.71 , 0.43 , 8.32 , 0.0007 , 8.75 , 10.03 , 0.035 , 1.12 , 1.745 , 280.0 , 0.69 , 1.81 )
395394
396- """
395+ @doc doc """
397396Hires Problem (Stiff)
398397
399398It is in the form of
400399
401400```math
402- \\ frac{dy}{dt} = f(y)
401+ \f rac{dy}{dt} = f(y)
403402```
404403
405404 with
406405
407406```math
408- y(0)=y_0, \\ quad y \\ in ℝ^8, \ \ quad 0 ≤ t ≤ 321.8122
407+ y(0)=y_0, \q uad y \i n ℝ^8, \q uad 0 ≤ t ≤ 321.8122
409408```
410409
411410where ``f`` is defined by
412411
413- ``f(y) = \\ begin{pmatrix} −1.71y_1 & +0.43y_2 & +8.32y_3 & +0.0007y_4 & \\\\ 1.71y_1 & −8.75y_2 & & & \\\\ −10.03y_3 & +0.43y_4 & +0.035y_5 & & \\\\ 8.32y_2 & +1.71y_3 & −1.12y_4 & & \\\\ −1.745y_5 & +0.43y_6 & +0.43y_7 & & \\\\ −280y_6y_8 & +0.69y_4 & +1.71y_5 & −0.43y_6 & +0.69y_7 \\\\ 280y_6y_8 & −1.81y_7 & & & \\\\ −280y_6y_8 & +1.81y_7 & & & \ \ end{pmatrix}``
412+ ``f(y) = \b egin{pmatrix} −1.71y_1 & +0.43y_2 & +8.32y_3 & +0.0007y_4 & \\ 1.71y_1 & −8.75y_2 & & & \\ −10.03y_3 & +0.43y_4 & +0.035y_5 & & \\ 8.32y_2 & +1.71y_3 & −1.12y_4 & & \\ −1.745y_5 & +0.43y_6 & +0.43y_7 & & \\ −280y_6y_8 & +0.69y_4 & +1.71y_5 & −0.43y_6 & +0.69y_7 \\ 280y_6y_8 & −1.81y_7 & & & \\ −280y_6y_8 & +1.81y_7 & & & \e nd{pmatrix}``
414413
415414Reference: [demohires.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoHires/demohires.pdf)
416415Notebook: [Hires.ipynb](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Hires.ipynb)
@@ -422,24 +421,24 @@ prob_ode_hires = ODEProblem(hires, u0, (0.0, 321.8122), p)
422421function orego (du, u, p, t)
423422 y1, y2, y3 = u
424423 p1, p2, p3 = p
425-
424+
426425 du[1 ] = p1 * (y2 + y1 * (1 - p2 * y1 - y2))
427426 du[2 ] = (y3 - (1 + y1) * y2) / p1
428427 du[3 ] = p3 * (y1 - y3)
429428end
430429
431- """
430+ @doc doc """
432431Orego Problem (Stiff)
433432
434- It is in the form of ``\\ frac{dy}{dt}=f(y), \\ quad y(0)=y0 ,`` with
433+ It is in the form of ``\f rac{dy}{dt}=f(y), \q uad y(0)=y_0 ,`` with
435434
436435```math
437- y \\ in ℝ^3, \ \ quad 0 ≤ t ≤ 360
436+ y \i n ℝ^3, \q uad 0 ≤ t ≤ 360
438437```
439438
440439where ``f`` is defined by
441440
442- ``f(y) = \\ begin{pmatrix} s(y_2 - y_1(1-qy_1-y_2)) \\\\ (y_3 - y_2(1+y_1))/s \\\\ w(y_1-y_3) \ \ end{pmatrix}``
441+ ``f(y) = \b egin{pmatrix} s(y_2 - y_1(1-qy_1-y_2)) \\ (y_3 - y_2(1+y_1))/s \\ w(y_1-y_3) \e nd{pmatrix}``
443442
444443where ``s=77.27``, ``w=0.161`` and ``q=8.375⋅10^{-6}``.
445444
0 commit comments