ODE Problems

Missing docstring.

Missing docstring for SciMLBase.ODEProblem. Check Documenter's build log for details.

Missing docstring.

Missing docstring for SciMLBase.ODEFunction. Check Documenter's build log for details.

Solution Type

Missing docstring.

Missing docstring for SciMLBase.ODESolution. Check Documenter's build log for details.

ODE Alias Specifier

Missing docstring.

Missing docstring for SciMLBase.ODEAliasSpecifier. Check Documenter's build log for details.

Example Problems

Example problems can be found in DiffEqProblemLibrary.jl.

To use a sample problem, such as prob_ode_linear, you can do something like:

#] add DiffEqProblemLibrary
import DiffEqProblemLibrary.ODEProblemLibrary
import DifferentialEquations as DE
# load problems
ODEProblemLibrary.importodeproblems()
prob = ODEProblemLibrary.prob_ode_linear
sol = DE.solve(prob)
ODEProblemLibrary.prob_ode_linearConstant

Linear ODE

\[\frac{du}{dt} = αu\]

with initial condition $u_0=\frac{1}{2}$, $α=1.01$, and solution

\[u(t) = u_0 e^{αt}\]

with Float64s. The parameter is $α$

ODEProblemLibrary.prob_ode_2DlinearConstant

4×2 version of the Linear ODE

\[\frac{du}{dt} = αu\]

with initial condition $u_0$ as all uniformly distributed random numbers, $α=1.01$, and solution

\[u(t) = u_0 e^{αt}\]

with Float64s

ODEProblemLibrary.prob_ode_bigfloat2DlinearConstant

4×2 version of the Linear ODE

\[\frac{du}{dt} = αu\]

with initial condition $u_0$ as all uniformly distributed random numbers, $α=1.01$, and solution

\[u(t) = u_0 e^{αt}\]

with BigFloats

ODEProblemLibrary.prob_ode_large2DlinearConstant

100×100 version of the Linear ODE

\[\frac{du}{dt} = αu\]

with initial condition $u_0$ as all uniformly distributed random numbers, $α=1.01$, and solution

\[u(t) = u_0 e^{αt}\]

with Float64s

ODEProblemLibrary.prob_ode_2Dlinear_notinplaceConstant

4×2 version of the Linear ODE

\[\frac{du}{dt} = αu\]

with initial condition $u_0$ as all uniformly distributed random numbers, $α=1.01$, and solution

\[u(t) = u_0 e^{αt}\]

on Float64. Purposefully not in-place as a test.

ODEProblemLibrary.prob_ode_lotkavolterraConstant

Lotka-Volterra Equations (Non-stiff)

\[\begin{align*} \frac{dx}{dt} &= ax - bxy \\ \frac{dy}{dt} &= -cy + dxy \\ \end{align*}\]

with initial condition $x=y=1$

ODEProblemLibrary.prob_ode_fitzhughnagumoConstant

Fitzhugh-Nagumo (Non-stiff)

\[\begin{align*} \frac{dv}{dt} &= v - \frac{v^3}{3} - w + I_{est} \\ τ \frac{dw}{dt} &= v + a -bw \end{align*}\]

with initial condition $v=w=1$

ODEProblemLibrary.prob_ode_threebodyConstant

The ThreeBody problem as written by Hairer: (Non-stiff)

\[\begin{align*} \frac{dy₁}{dt} &= y₁ + 2\frac{dy₂}{dt} - \bar{μ}\frac{y₁+μ}{D₁} - μ\frac{y₁-\bar{μ}}{D₂} \\ \frac{dy₂}{dt} &= y₂ - 2\frac{dy₁}{dt} - \bar{μ}\frac{y₂}{D₁} - μ\frac{y₂}{D₂} \end{align*}\]

\[\begin{align*} D₁ &= \left((y₁+μ)^2 + y₂^2\right)^{3/2} \\ D₂ &= \left((y₁-\bar{μ})^2 + y₂^2\right)^{3/2} \\ μ &= 0.012277471 \\ \bar{μ} &= 1-μ \end{align*}\]

From Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129

Usually solved on $t₀ = 0.0$ and $T = 17.0652165601579625588917206249$ Periodic with that setup.

ODEProblemLibrary.prob_ode_pleiadesConstant

Pleiades Problem (Non-stiff)

\[\begin{align*} \frac{d^2xᵢ}{dt^2} &= \sum_{j≠i} mⱼ(xⱼ-xᵢ)/rᵢⱼ \\ \frac{d^2yᵢ}{dt^2} &= \sum_{j≠i} mⱼ(yⱼ-yᵢ)/rᵢⱼ \end{align*}\]

where

\[rᵢⱼ = \left((xᵢ-xⱼ)^2 + (yᵢ-yⱼ)^2\right)^{3/2}\]

and initial conditions are

\[\begin{align*} x₁(0) &= 3, & y₁(0) &= 3, \\ x₂(0) &= 3, & y₂(0) &= -3, \\ x₃(0) &= -1, & y₃(0) &= 2, \\ x₄(0) &= -3, & y₄(0) &= 0, \\ x₅(0) &= 2, & y₅(0) &= 0, \\ x₆(0) &= -2, & y₆(0) &= -4, \\ x₇(0) &= 2, & y₇(0) &= 4 \end{align*}\]

and with $\frac{dxᵢ(0)}{dt} = \frac{dyᵢ(0)}{dt} = 0$ except for

\[\begin{align*} \frac{dx₆(0)}{dt} &= 1.75, & \frac{dx₇(0)}{dt} &= -1.5, \\ \frac{dy₄(0)}{dt} &= -1.25, & \frac{dy₅(0)}{dt} &= 1 \end{align*}\]

From Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 244

Usually solved from 0 to 3.

ODEProblemLibrary.prob_ode_vanderpolConstant

Van der Pol Equations

\[\begin{align*} \frac{dx}{dt} &= y \\ \frac{dy}{dt} &= μ \left(\left(1-x^2\right) y - x\right) \end{align*}\]

with $μ=1.0$ and $u_0=[\sqrt{3}, 0]$ (where $u[1] = x$, $u[2] = y$)

Non-stiff parameters.

ODEProblemLibrary.prob_ode_vanderpol_stiffConstant

Van der Pol Equations

\[\begin{align*} \frac{dx}{dt} &= y \\ \frac{dy}{dt} &= μ \left(\left(1 - x^2\right) y - x\right) \end{align*}\]

with $μ=10^6$ and $u_0=[\sqrt{3}, 0]$ (where $u[1] = x$, $u[2] = y$)

Stiff parameters.

ODEProblemLibrary.prob_ode_roberConstant

The Robertson biochemical reactions: (Stiff)

\[\begin{align*} \frac{dy₁}{dt} &= -k₁y₁ + k₃y₂y₃ \\ \frac{dy₂}{dt} &= k₁y₁ - k₂y₂^2 - k₃y₂y₃ \\ \frac{dy₃}{dt} &= k₂y₂^2 \end{align*}\]

where $k₁=0.04$, $k₂=3×10^7$, $k₃=10^4$. For details, see:

Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 129

Usually solved on $[0,10^{11}]$

ODEProblemLibrary.prob_ode_rigidbodyConstant

Rigid Body Equations (Non-stiff)

\[\begin{align*} \frac{dy₁}{dt} &= I₁y₂y₃ \\ \frac{dy₂}{dt} &= I₂y₁y₃ \\ \frac{dy₃}{dt} &= I₃y₁y₂ \end{align*}\]

with $I₁=-2$, $I₂=1.25$, and $I₃=-1/2$.

The initial condition is $y=[1.0;0.0;0.9]$.

From Solving Differential Equations in R by Karline Soetaert

or Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Problems Page 244

Usually solved from 0 to 20.

ODEProblemLibrary.prob_ode_hiresConstant

Hires Problem (Stiff)

It is in the form of

\[\frac{dy}{dt} = f(y)\]

with

\[ y(0)=y_0, \quad y \in ℝ^8, \quad 0 ≤ t ≤ 321.8122\]

where $f$ is defined by

\[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}\]

Reference: demohires.pdf Notebook: Hires.ipynb

ODEProblemLibrary.prob_ode_oregoConstant

Orego Problem (Stiff)

It is in the form of $\frac{dy}{dt}=f(y), \quad y(0)=y_0,$ with

\[y \in ℝ^3, \quad 0 ≤ t ≤ 360\]

where $f$ is defined by

\[f(y) = \begin{pmatrix} s(y_2 - y_1 (1 - q y_1 - y_2)) \\ (y_3 - y_2 (1 + y_1)) / s \\ w (y_1 - y_3) \end{pmatrix}\]

where $s=77.27$, $w=0.161$ and $q=8.375×10^{-6}$.

Reference: demoorego.pdf Notebook: Orego.ipynb

ODEProblemLibrary.prob_ode_pollutionConstant

Pollution Problem (Stiff)

This IVP is a stiff system of 20 non-linear Ordinary Differential Equations. It is in the form of

\[\frac{dy}{dt}=f(y)\]

with

\[y(0)=y_0, \quad y \in ℝ^{20}, \quad 0 ≤ t ≤ 60\]

where $f$ is defined by

\[f(y) = \begin{pmatrix} -\sum_{j\in{1,10,14,23,24}} r_j + \sum_{j\in{2,3,9,11,12,22,25}} r_j \\ -r_2 - r_3 - r_9 - r_12 + r_1 + r_{21} \\ -r_{15} + r_1 + r_{17} + r_{19} + r_{22} \\ -r_2 - r_{16} - r_{17} - r_{23} + r_{15} \\ -r_3 + 2r_4 + r_6 + r_7 + r_{13} + r_{20} \\ -r_6 - r_8 - r_{14} - r_{20} + r_3 + 2r_{18} \\ -r_4 - r_5 - r_6 + r_{13} \\ r_4 + r_5 + r_6 + r_7 \\ -r_7 - r_8 \\ -r_{12} + r_7 + r_9 \\ -r_9 - r_{10} + r_8 + r_{11} \\ r_9 \\ -r_{11} + r_{10} \\ -r_{13} + r_{12} \\ r_{14} \\ -r_{18} - r_{19} + r_{16} \\ -r_{20} \\ r_{20} \\ -r_{21} - r_{22} - r_{24} + r_{23} + r_{25} \\ -r_{25} + r_{24} \end{pmatrix}\]

with the initial condition of

\[y0 = (0, 0.2, 0, 0.04, 0, 0, 0.1, 0.3, 0.01, 0, 0, 0, 0 ,0, 0, 0, 0.007, 0, 0, 0)^T\]

Analytical Jacobian is included.

Reference: pollu.pdf Notebook: Pollution.ipynb

ODEProblemLibrary.prob_ode_nonlinchemConstant

Nonlinear system of reactions with an analytical solution

\[\begin{align*} \frac{dy_1}{dt} &= -y_1 \\ \frac{dy_2}{dt} &= y_1 - y_2^2 \\ \frac{dy_3}{dt} &= y_2^2 \end{align*}\]

with initial condition $y=[1;0;0]$ on a time span of $t \in (0,20)$

From

Liu, L. C., Tian, B., Xue, Y. S., Wang, M., & Liu, W. J. (2012). Analytic solution for a nonlinear chemistry system of ordinary differential equations. Nonlinear Dynamics, 68(1-2), 17-21.

The analytical solution is implemented, allowing easy testing of ODE solvers.

ODEProblemLibrary.prob_ode_brusselator_1dConstant

1D Brusselator

\[\begin{align*} \frac{∂u}{∂t} &= A - (B+1) u + u^2 v + α \frac{∂^2 u}{∂x^2} \\ \frac{∂v}{∂t} &= B u - u^2 v + α \frac{∂^2 u}{∂x^2} \end{align*}\]

and the initial conditions are

\[\begin{align*} u(x,0) &= 1 + \sin(2πx) \\ v(x,0) &= 3 \end{align*}\]

with periodic boundary conditions

\[\begin{align*} u(0,t) &= u(1,t) \\ v(0,t) &= v(1,t) \end{align*}\]

From Hairer Norsett Wanner Solving Ordinary Differential Equations II - Stiff and Differential-Algebraic Problems Page 6

ODEProblemLibrary.prob_ode_brusselator_2dConstant

2D Brusselator

\[\begin{align*} \frac{∂u}{∂t} &= 1 + u^2v - 4.4u + α\left(\frac{∂^2 u}{∂x^2} + \frac{∂^2 u}{∂y^2}\right) + f(x, y, t) \\ \frac{∂v}{∂t} &= 3.4u - u^2v + α\left(\frac{∂^2 u}{∂x^2} + \frac{∂^2 u}{∂y^2}\right) \end{align*}\]

where

\[f(x, y, t) = \begin{cases} 5 & \text{if } (x-0.3)^2+(y-0.6)^2 ≤ 0.1^2 \text{ and } t ≥ 1.1 \\ 0 & \text{else} \end{cases}\]

and the initial conditions are

\[\begin{align*} u(x, y, 0) &= 22 ⋅ y(1-y)^{3/2} \\ v(x, y, 0) &= 27 ⋅ x(1-x)^{3/2} \end{align*}\]

with the periodic boundary condition

\[\begin{align*} u(x+1,y,t) &= u(x,y,t) \\ u(x,y+1,t) &= u(x,y,t) \end{align*}\]

From Hairer Norsett Wanner Solving Ordinary Differential Equations II - Stiff and Differential-Algebraic Problems Page 152

ODEProblemLibrary.prob_ode_filamentConstant

Filament PDE Discretization

Notebook: Filament.ipynb

In this problem is a real-world biological model from a paper entitled Magnetic dipole with a flexible tail as a self-propelling microdevice. It is a system of PDEs representing a Kirchhoff model of an elastic rod, where the equations of motion are given by the Rouse approximation with free boundary conditions.

ODEProblemLibrary.prob_ode_thomasConstant

Thomas' cyclically symmetric attractor equations

\[\begin{align*} \frac{dx}{dt} &= \sin(y) - bx \\ \frac{dy}{dt} &= \sin(z) - by \\ \frac{dz}{dt} &= \sin(x) - bz \end{align*}\]

with parameter $b = 0.208186$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

Wikipedia

ODEProblemLibrary.prob_ode_lorenzConstant

Lorenz equations

\[\begin{align*} \frac{dx}{dt} &= σ(y - x) \\ \frac{dy}{dt} &= x(ρ - z) - y \\ \frac{dz}{dt} &= xy - βz \end{align*}\]

with parameters $σ=10, ρ=28, β=8/3$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

Wikipedia

ODEProblemLibrary.prob_ode_aizawaConstant

Aizawa equations

\[\begin{align*} \frac{dx}{dt} &= (z - b)x - dy \\ \frac{dy}{dt} &= dx + (z - b)y \\ \frac{dz}{dt} &= c + az - \frac{z^3}{3} - (x^2 + y^2)(1 + ez) + fzx^3 \end{align*}\]

with parameters $a=0.95, b=0.7, c=0.6, d=3.5, e=0.25, f=0.1$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

ODEProblemLibrary.prob_ode_dadrasConstant

Dadras equations

\[\begin{align*} \frac{dx}{dt} &= y - ax + byz \\ \frac{dy}{dt} &= cy - xz + z \\ \frac{dz}{dt} &= dxy - ez \end{align*}\]

with parameters $a=3, b=2.7, c=1.7, d=2, e=9$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

ODEProblemLibrary.prob_ode_chenConstant

Chen equations

\[\begin{align*} \frac{dx}{dt} &= a(y - x) \\ \frac{dy}{dt} &= (c - a)x - xz + cy \\ \frac{dz}{dt} &= xy - bz \end{align*}\]

with parameters $a=35, b=3, c=28$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

ODEProblemLibrary.prob_ode_rosslerConstant

Rössler equations

\[\begin{align*} \frac{dx}{dt} &= -(y + z) \\ \frac{dy}{dt} &= x + ay \\ \frac{dz}{dt} &= b + z(x - c) \end{align*}\]

with parameters $a=0.2, b=0.2, c=5.7$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

ReferenceWikipedia

ODEProblemLibrary.prob_ode_rabinovich_fabrikantConstant

Rabinovich-Fabrikant equations

\[\begin{align*} \frac{dx}{dt} &= y(z - 1 + x^2) + bx \\ \frac{dy}{dt} &= x(3z + 1 - x^2) + by \\ \frac{dz}{dt} &= -2z(a + xy) \end{align*}\]

with parameters $a=0.14, b=0.10$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

ODEProblemLibrary.prob_ode_sprottConstant

Sprott equations

\[\begin{align*} \frac{dx}{dt} &= y + axy + xz \\ \frac{dy}{dt} &= 1 - bx^2 + yz \\ \frac{dz}{dt} &= x - x^2 - y^2 \end{align*}\]

with parameters $a=2.07, b=1.79$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference

ODEProblemLibrary.prob_ode_hindmarsh_roseConstant

Hindmarsh-Rose equations

\[\begin{align*} \frac{dx}{dt} &= y - ax^3 + bx^2 - z + i \\ \frac{dy}{dt} &= c - dx^2 - y \\ \frac{dz}{dt} &= r(s(x - x_r) - z) \end{align*}\]

with parameters $a=1, b=3, c=1, d=5, r=10^{-2}, s=4, x_r=-8/5, i=5$ and initial conditions $x(0)=1, y(0)=0, z(0)=0$

Reference