NSDEBase.jl
This is the documentation of NSDEBase.jl, a Julia package containing common types and utility functions shared by NSDE.jl and its subpackages.
API
All exported types and functions are considered part of the public API, and thus documented in this manual.
NSDEBase.AbstractCache
— TypeAn abstract type for caching intermediate computations in AbstractSolver
s.
NSDEBase.AbstractInitialValueCache
— TypeAn abstract type for caching intermediate computations in AbstractInitialValueSolver
s.
NSDEBase.AbstractInitialValueParameters
— TypeAn abstract type for parameters in AbstractInitialValueSolver
s.
NSDEBase.AbstractInitialValueProblem
— TypeAn abstract type for initial value problems (IVPs).
NSDEBase.AbstractInitialValueSolution
— TypeAn abstract type for computed solutions of AbstractInitialValueProblem
s.
NSDEBase.AbstractInitialValueSolver
— TypeAn abstract type for numerical solvers of AbstractInitialValueProblem
s.
NSDEBase.AbstractObject
— TypeAn abstract type for all objects in NSDEBase.
NSDEBase.AbstractParameters
— TypeAn abstract type for parameters used in AbstractSolver
s.
NSDEBase.AbstractProblem
— TypeAn abstract type for differential-equation problems.
NSDEBase.AbstractRightHandSide
— TypeAn abstract type for right-hand-side (RHS) functions of AbstractInitialValueProblem
s.
NSDEBase.AbstractSolution
— TypeAn abstract type for solutions of AbstractProblem
s.
NSDEBase.AbstractSolver
— TypeAn abstract type for numerical solvers of AbstractProblem
s.
NSDEBase.InitialValueProblem
— TypeInitialValueProblem <: AbstractInitialValueProblem
A composite type for an initial-value problem.
Constructors
InitialValueProblem(rhs, u0, tspan)
InitialValueProblem(rhs, u0, t0, tN)
IVP(args...; kwargs...)
Arguments
rhs::AbstractRightHandSide
: right-hand side functionu0::AbstractVector
: initial conditiontspan::Tuple
: end limits of time domain
Functions
copy
: copy instance of problem with updated parameters
NSDEBase.LinearRightHandSide
— TypeLinearRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the form $f(u, t) = L u + g(t)$.
Constructors
LinearRightHandSide(L, g, g!)
LinearRightHandSide(L[, g!_or_g])
LRHS(args...; kwargs...)
Arguments
L::AbstractMatrix
: $L$, the coefficient termg::Function
: $g$, the forcing term, independent of $u$g!::Function
: $g$ but in-place
NSDEBase.LinearRightHandSide
— Method(rhs::LinearRightHandSide)(u, t)
(rhs::LinearRightHandSide)(du, u, t)
returns the derivative du
from the solution u
and time t
.
NSDEBase.NonlinearRightHandSide
— TypeNonlinearRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the generic form $f(u, t)$.
Constructors
NonlinearRightHandSide(f, f!, Df, Df!)
NonlinearRightHandSide(f!_or_f, iscomplex=false)
RightHandSide(args...; kwargs...)
RHS(args...; kwargs...)
Arguments
f::Function
: $f$, the right-hand side functionf!::Function
: $f$ but in-placeDf::Function
: $\mathcal{D}f$, the Jacobian of $f$ with respect to $u$Df!::Function
: $\mathcal{D}f$ but in-place
NSDEBase.NonlinearRightHandSide
— Method(rhs::NonlinearRightHandSide)(u, t)
(rhs::NonlinearRightHandSide)(du, u, t)
returns the derivative du
from the solution u
and time t
.
NSDEBase.SplitRightHandSide
— TypeSplitRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the form $f(u, t) = f_\text{s}(u, t) + f_\text{ns}(u, t)$.
Constructors
SplitRightHandSide(fₛ, fₙₛ)
SRHS(args...; kwargs...)
Arguments
fₛ::Union{LinearRightHandSide,NonlinearRightHandSide}
: $f_\text{s}$, the stiff part of the right-hand side function $f$fₙₛ::NonlinearRightHandSide}
: $f_\text{ns}$, the non-stiff part of the right-hand side function $f$
NSDEBase.SplitRightHandSide
— Method(rhs::SplitRightHandSide)(u, t)
(rhs::SplitRightHandSide)(du, u, t)
returns the derivative du
from the solution u
and time t
.
Base.copy
— Methodcopy(problem, u0, tspan)::InitialValueProblem
copy(problem, u0, t0, tN)::InitialValueProblem
returns a copy of problem
with the same rhs
but different u0
and tspan
.
Base.show
— Methodshow(io::IO, object::AbstractObject)
prints the full description of an object
and its contents to a stream io
.
Base.summary
— Methodsummary(io::IO, object::AbstractObject)
prints the short description of an object
to a stream io
.
NSDEBase.Dahlquist
— FunctionDahlquist(u0=0.5, tspan=(0.0, 1.0); λ=1.0)::InitialValueProblem
Dahlquist(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the Dahlquist equation.
NSDEBase.DoublePendulum
— FunctionDoublePendulum(u0=[π/4, π/4, 0.0, 0.0], tspan=(0.0, 1.0); μ=1.0, λ=1.0)::InitialValueProblem
DoublePendulum(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the double pendulum problem.
NSDEBase.IVP
— MethodInitialValueProblem <: AbstractInitialValueProblem
A composite type for an initial-value problem.
Constructors
InitialValueProblem(rhs, u0, tspan)
InitialValueProblem(rhs, u0, t0, tN)
IVP(args...; kwargs...)
Arguments
rhs::AbstractRightHandSide
: right-hand side functionu0::AbstractVector
: initial conditiontspan::Tuple
: end limits of time domain
Functions
copy
: copy instance of problem with updated parameters
NSDEBase.LRHS
— MethodLinearRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the form $f(u, t) = L u + g(t)$.
Constructors
LinearRightHandSide(L, g, g!)
LinearRightHandSide(L[, g!_or_g])
LRHS(args...; kwargs...)
Arguments
L::AbstractMatrix
: $L$, the coefficient termg::Function
: $g$, the forcing term, independent of $u$g!::Function
: $g$ but in-place
NSDEBase.Logistic
— FunctionLogistic(u0=0.5, tspan=(0.0, 1.0); λ=1.0)::InitialValueProblem
Logistic(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the Logistic equation.
NSDEBase.Lorenz
— FunctionLorenz(u0=[2.0, 3.0, -14.0], tspan=(0.0, 1.0); σ=10.0, β=8/3, ρ=28.0)::InitialValueProblem
Lorenz(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the Lorenz equations.
NSDEBase.Lorenz96
— FunctionLorenz96(u0=[ones(39); 1.01], tspan=(0.0, 1.0); F=8.0)::InitialValueProblem
Lorenz96(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the Lorenz-96 equations.
NSDEBase.RHS
— MethodNonlinearRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the generic form $f(u, t)$.
Constructors
NonlinearRightHandSide(f, f!, Df, Df!)
NonlinearRightHandSide(f!_or_f, iscomplex=false)
RightHandSide(args...; kwargs...)
RHS(args...; kwargs...)
Arguments
f::Function
: $f$, the right-hand side functionf!::Function
: $f$ but in-placeDf::Function
: $\mathcal{D}f$, the Jacobian of $f$ with respect to $u$Df!::Function
: $\mathcal{D}f$ but in-place
NSDEBase.RightHandSide
— MethodNonlinearRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the generic form $f(u, t)$.
Constructors
NonlinearRightHandSide(f, f!, Df, Df!)
NonlinearRightHandSide(f!_or_f, iscomplex=false)
RightHandSide(args...; kwargs...)
RHS(args...; kwargs...)
Arguments
f::Function
: $f$, the right-hand side functionf!::Function
: $f$ but in-placeDf::Function
: $\mathcal{D}f$, the Jacobian of $f$ with respect to $u$Df!::Function
: $\mathcal{D}f$ but in-place
NSDEBase.Rössler
— FunctionRössler(u0=[2.0, 0.0, 0.0], tspan=(0.0, 1.0); α=0.2, β=0.2, γ=5.7)::InitialValueProblem
Rössler(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the Rössler equations.
NSDEBase.SRHS
— MethodSplitRightHandSide <: AbstractRightHandSide
A composite type for the right-hand side of an InitialValueProblem
in the form $f(u, t) = f_\text{s}(u, t) + f_\text{ns}(u, t)$.
Constructors
SplitRightHandSide(fₛ, fₙₛ)
SRHS(args...; kwargs...)
Arguments
fₛ::Union{LinearRightHandSide,NonlinearRightHandSide}
: $f_\text{s}$, the stiff part of the right-hand side function $f$fₙₛ::NonlinearRightHandSide}
: $f_\text{ns}$, the non-stiff part of the right-hand side function $f$
NSDEBase.SimplePendulum
— FunctionSimplePendulum(u0=[π/4, 0.0], tspan=(0.0, 2π/3 * √9.81))::InitialValueProblem
SimplePendulum(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the simple pendulum problem.
NSDEBase.VanDerPol
— FunctionVanDerPol(u0=[1.0, 0.0], tspan=(0.0, 1.0); μ=1.0)::InitialValueProblem
VanDerPol(u0, t0, tN; kwargs...)::InitialValueProblem
returns an InitialValueProblem
for the Van der Pol equation (in first-order form).