Problem Types
The general fractional differential equations problem type.
FODE Problem
FractionalDiffEq.FODEProblem
— TypeDefines an fractional ordinary differential equation (FODE) problem.
Mathematical Specification of an FODE problem
To define an FODE Problem, you simply need to given the function $f$ and the initial condition $u_0$ which define an FODE:
\[\frac{du^\alpha}{d^{\alpha}t} = f(u,p,t)\]
There are two different ways of specifying f
:
f(du,u,p,t)
: in-place. Memory-efficient when avoiding allocations. Best option for most cases unless mutation is not allowed.f(u,p,t)
: returningdu
. Less memory-efficient way, particularly suitable when mutation is not allowed (e.g. with certain automatic differentiation packages such as Zygote).order
: the fractional order of the differential equations, commensurate and non-commensurate is both supported. -u₀
should be an AbstractArray (or number) whose geometry matches the desired geometry ofu
. Note that we are not limited to numbers or vectors foru₀
; one is allowed to provideu₀
as arbitrary matrices / higher dimension tensors as well.
Problem Type
Constructors
FODEProblem
can be constructed by first building an ODEFunction
or by simply passing the FODE right-hand side to the constructor. The constructors are:
FODEProblem(f::ODEFunction,u0,tspan,p=NullParameters();kwargs...)
FODEProblem{isinplace,specialize}(f,u0,tspan,p=NullParameters();kwargs...)
: Defines the FODE with the specified functions.isinplace
optionally sets whether the function is inplace or not. This is determined automatically, but not inferred.specialize
optionally controls the specialization level. See the specialization levels section of the SciMLBase documentation for more details. The default isAutoSpecialize
.
For more details on the in-place and specialization controls, see the ODEFunction documentation.
Parameters are optional, and if not given, then a NullParameters()
singleton will be used which will throw nice errors if you try to index non-existent parameters. Any extra keyword arguments are passed on to the solvers. For example, if you set a callback
in the problem, then that callback
will be added in every solve call.
For specifying Jacobians and mass matrices, see the ODEFunction
documentation.
Fields
f
: The function in the ODE.order
: The order of the FODE.u0
: The initial condition.tspan
: The timespan for the problem.p
: The parameters.kwargs
: The keyword arguments passed onto the solves.
Example Problem
using SciMLBase
function lorenz!(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
order = [0.96; 0.96; 0.96]
u0 = [1.0; 0.0; 0.0]
tspan = (0.0, 100.0)
prob = FODEProblem(lorenz!, u0, tspan)
# Test that it worked
using FractionalDiffEq
sol = solve(prob, PIEX())
using Plots;
plot(sol, vars = (1, 2, 3));
Multi-terms FODE problems
FractionalDiffEq.MultiTermsFODEProblem
— TypeDefines an multiple terms linear fractional ordinary differential equation (FODE) problem.
Mathematical Specification of an multi-terms FODE problem
To define an multi-terms FODE Problem, you simply need to given the parameters, their correspoding orders, right hand side function and the initial condition $u_0$ which define an FODE:
\[\frac{du^\alpha}{d^{\alpha}t} = f(u,p,t)\]
Multiple terms fractional order differential equations.
FDDE Problem
FractionalDiffEq.FDDEProblem
— TypeDefines a fractional delay differential equation (FDDE) problem.
Mathematical Specification of an FDDE problem
To define an FDDE problem, you simply need to given the function $f$, the history function $ϕ$, the fractional order $α$, the delay $τ$ and the initial condition $u₀$ which define an FDDE:
\[D^\alpha_t y(t)=f(t,y(t),y(t-τ)),t ≥ 0\]
\[y(t)=ϕ(t), t ≤ 0\]
There are two different ways of specifying f
:
f(du,u,h,p,t)
: The function describing fractional delay differential equations.f(u,h,p,t)
: returningdu
. Less memory-efficient way, particularly suitable when mutation is not allowed (e.g. with certain automatic differentiation packages such as Zygote).ϕ
: History functionα
: The fractional order of the differential equations, commensurate and non-commensurate is both supported.τ
: The time delay of the differential equations.
Problem Type
Constructors
FODEProblem
can be constructed by first building an ODEFunction
or by simply passing the FODE right-hand side to the constructor. The constructors are:
FDDEProblem(f::ODEFunction,order,u0,ϕ,tspan,p=NullParameters();kwargs...)
FDDEProblem{isinplace,specialize}(f,order,u0,ϕ,tspan,p=NullParameters();kwargs...)
: Defines the FODE with the specified functions.isinplace
optionally sets whether the function is inplace or not. This is determined automatically, but not inferred.specialize
optionally controls the specialization level. See the specialization levels section of the SciMLBase documentation for more details. The default isAutoSpecialize
.
For more details on the in-place and specialization controls, see the ODEFunction documentation.
Parameters are optional, and if not given, then a NullParameters()
singleton will be used which will throw nice errors if you try to index non-existent parameters. Any extra keyword arguments are passed on to the solvers. For example, if you set a callback
in the problem, then that callback
will be added in every solve call.
For specifying Jacobians and mass matrices, see the ODEFunction
documentation.
Fields
f
: The function in the FDDE.ϕ
: The history function in the FDDE.order
: The order of the FDDE.τ
: The time delay of the FDDE.tspan
: The timespan for the problem.p
: The parameters.kwargs
: The keyword arguments passed onto the solves.
Example Problem
function ϕ(p, t)
if t == 0
return 19.00001
else
return 19.0
end
end
function f(y, ϕ, p, t)
return 3.5 * y * (1 - ϕ / 19)
end
τ = [0.8]
order = 0.97
u0 = 19.00001
tspan = (0.0, 2.0)
dt = 0.5
prob = FDDEProblem(f, order, u0, ϕ, constant_lags = τ, tspan)
sol = solve(prob, DelayPIEX(), dt = dt)
FFODE Problem
FFPODEProblem FFEODEProblem FFMODEProblem
DODE Problem
FractionalDiffEq.DODEProblem
— TypeDefines an distributed order fractional ordinary differential equation (DODE) problem.
Mathematical Specification of an distributed order FODE problem
To define an multi-terms FODE Problem, you simply need to given the parameters, their correspoding orders, right hand side function and the initial condition $u_0$ which define an FODE:
\[\frac{du^\alpha}{d^{\alpha}t} = f(u,p,t)\]
Distributed order differential equations.
Fractional Difference Problem
FractionalDifferenceProblem FractionalDifferenceSystem