ODE Types

Mathematical Specification of an ODE Problem

To define an ODE Problem, you simply need to give the function $f$ and the initial condition $u₀$ which define an ODE:

\[\frac{du}{dt} = f(t,u)\]

f should be specified as f(t,u) (or in-place as f(t,u,du)), and u₀ should be an AbstractArray (or number) whose geometry matches the desired geometry of u. Note that we are not limited to numbers or vectors for u₀; one is allowed to provide u₀ as arbitrary matrices / higher dimension tensors as well.

Problem Type

Constructors

ODEProblem(f,u0,tspan) : Defines the ODE with the specified functions.

Fields

Special Solver Options

Special Solution Fields

None. The ODE type is as basic as it gets.

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:

# Pkg.add("DiffEqProblemLibrary")
using DiffEqProblemLibrary
prob = prob_ode_linear
sol = solve(prob)

Linear ODE

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

with initial condition $u0=1/2$, $α=1.01$, and solution

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

with Float64s

source

4x2 version of the Linear ODE

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

with initial condition $u0=1/2$, $α=1.01$, and solution

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

with Float64s

source

Linear ODE

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

with initial condition $u0=1/2$, $α=1.01$, and solution

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

with BigFloats

source

4x2 version of the Linear ODE

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

with initial condition $u0=1/2$, $α=1.01$, and solution

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

with BigFloats

source

100x100 version of the Linear ODE

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

with initial condition $u0=1/2$, $α=1.01$, and solution

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

with Float64s

source

4x2 version of the Linear ODE

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

with initial condition $u0=1/2$, $α=1.01$, and solution

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

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

source

The ThreeBody problem as written by Hairer:

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

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

Usually solved on t₀ = 0.0; T = parse(BigFloat,"17.0652165601579625588917206249") Periodic with that setup.

source

Pleides Problem

\[\begin{align} xᵢ′′ &= \sum_{j≠i} mⱼ(xⱼ-xᵢ)/rᵢⱼ \\ yᵢ′′ &= \sum_{j≠i} mⱼ(yⱼ-yᵢ)/rᵢⱼ \end{align}\]

where

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

and inital condtions are

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

and with $xᵢ′(0)=yᵢ′(0)=0$ except for

\[\begin{align} x₆′(0)&=1.75 \\ x₇′(0)&=-1.5 \\ y₄′(0)&=-1.25 \\ y₅′(0)&=1 \end{align}\]

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

Usually solved from 0 to 3.

source

Van der Pol Equations

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

with $μ=1.0$ and $u0=[0,\sqrt{3}]$

Non-stiff parameters.

source

Van der Pol Equations

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

with $μ=10^6$ and $u0=[0,\sqrt{3}]$

Stiff parameters.

source

The Robertson biochemical reactions:

\[\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\times10^7$, $k₃=10^4$. For details, see:

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

Usually solved on [0,1e11]

source

Rigid Body Equations

\[\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 Euations I - Nonstiff Problems Page 244

Usually solved from 0 to 20.

source