ODE Problems
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:
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,callback=CallbackSet(),mass_matrix=I) : Defines the ODE with the specified functions.
Fields
f: The function in the ODE.u0: The initial condition.tspan: The timespan for the problem.callback: A callback to be applied to every solver which uses the problem. Defaults to nothing.mass_matrix: The mass-matrix. Defaults toI, theUniformScalingidentity matrix.
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)DiffEqProblemLibrary.prob_ode_linear — Constant.Linear ODE
with initial condition $u0=1/2$, $α=1.01$, and solution
with Float64s
DiffEqProblemLibrary.prob_ode_2Dlinear — Constant.4x2 version of the Linear ODE
with initial condition $u0=1/2$, $α=1.01$, and solution
with Float64s
DiffEqProblemLibrary.prob_ode_bigfloatlinear — Constant.Linear ODE
with initial condition $u0=1/2$, $α=1.01$, and solution
with BigFloats
DiffEqProblemLibrary.prob_ode_bigfloat2Dlinear — Constant.4x2 version of the Linear ODE
with initial condition $u0=1/2$, $α=1.01$, and solution
with BigFloats
DiffEqProblemLibrary.prob_ode_large2Dlinear — Constant.100x100 version of the Linear ODE
with initial condition $u0=1/2$, $α=1.01$, and solution
with Float64s
4x2 version of the Linear ODE
with initial condition $u0=1/2$, $α=1.01$, and solution
on Float64. Purposefully not in-place as a test.
DiffEqProblemLibrary.prob_ode_threebody — Constant.The ThreeBody problem as written by Hairer:
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.
DiffEqProblemLibrary.prob_ode_pleides — Constant.Pleides Problem
where
and inital condtions are
and with $xᵢ′(0)=yᵢ′(0)=0$ except for
From Hairer Norsett Wanner Solving Ordinary Differential Euations I - Nonstiff Problems Page 244
Usually solved from 0 to 3.
DiffEqProblemLibrary.prob_ode_vanderpol — Constant.Van der Pol Equations
with $μ=1.0$ and $u0=[0,\sqrt{3}]$
Non-stiff parameters.
DiffEqProblemLibrary.prob_ode_vanderpol_stiff — Constant.Van der Pol Equations
with $μ=10^6$ and $u0=[0,\sqrt{3}]$
Stiff parameters.
DiffEqProblemLibrary.prob_ode_rober — Constant.The Robertson biochemical reactions:
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]
DiffEqProblemLibrary.prob_ode_rigidbody — Constant.Rigid Body Equations
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.