SciMLAlgorithms
Definition of the AbstractSciMLAlgorithm Interface
SciMLAlgorithms
are defined as types which have dispatches to the function signature:
CommonSolve.solve(prob::AbstractSciMLProblem, alg::AbstractSciMLAlgorithm; kwargs...)
Algorithm-Specific Arguments
Note that because the keyword arguments of solve
are designed to be common across the whole problem type, algorithms should have the algorithm-specific keyword arguments defined as part of the algorithm constructor. For example, Rodas5
has a choice of autodiff::Bool
which is not common across all ODE solvers, and thus autodiff
is a algorithm-specific keyword argument handled via Rodas5(autodiff=true)
.
Remake
Note that remake
is applicable to AbstractSciMLAlgorithm
types, but this is not used in the public API. It's used for solvers to swap out components like ForwardDiff chunk sizes.
Common Algorithm Keyword Arguments
Commonly used algorithm keyword arguments are:
Traits
SciMLBase.isautodifferentiable
— Functionisautodifferentiable(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm is compatible with direct automatic differentiation, i.e. can have algorithms like ForwardDiff or ReverseDiff attempt to differentiate directly through the solver.
Defaults to false as only pure-Julia algorithms can have this be true.
SciMLBase.allows_arbitrary_number_types
— Functionallows_arbitrary_number_types(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm is compatible with direct automatic differentiation, i.e. can have algorithms like ForwardDiff or ReverseDiff attempt to differentiate directly through the solver.
Defaults to false as only pure-Julia algorithms can have this be true.
SciMLBase.allowscomplex
— Functionallowscomplex(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm is compatible with having complex numbers as the state variables.
Defaults to false.
SciMLBase.isadaptive
— Functionisadaptive(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm uses adaptivity, i.e. has a non-quasi-static compute graph.
Defaults to true.
isadaptive(i::DEIntegrator)
Checks if the integrator is adaptive
SciMLBase.isdiscrete
— Functionisdiscrete(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm allows for discrete state values, such as integers.
Defaults to false.
SciMLBase.forwarddiffs_model
— Functionforwarddiffs_model(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm uses ForwardDiff.jl on the model function is called with ForwardDiff.jl
Defaults to false as only pure-Julia algorithms can have this be true.
SciMLBase.forwarddiffs_model_time
— Functionforwarddiffs_model_time(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm uses ForwardDiff.jl on the model f(u,p,t)
function is called with ForwardDiff.jl on the t
argument.
Defaults to false as only a few pure-Julia algorithms (Rosenbrock methods) have this as true
Abstract SciML Algorithms
SciMLBase.AbstractSciMLAlgorithm
— Typeabstract type AbstractSciMLAlgorithm
SciMLBase.AbstractDEAlgorithm
— Typeabstract type AbstractDEAlgorithm <: SciMLBase.AbstractSciMLAlgorithm
SciMLBase.AbstractLinearAlgorithm
— Typeabstract type AbstractLinearAlgorithm <: SciMLBase.AbstractSciMLAlgorithm
SciMLBase.AbstractNonlinearAlgorithm
— Typeabstract type AbstractNonlinearAlgorithm <: SciMLBase.AbstractSciMLAlgorithm
SciMLBase.AbstractIntervalNonlinearAlgorithm
— Typeabstract type AbstractIntervalNonlinearAlgorithm <: SciMLBase.AbstractSciMLAlgorithm
SciMLBase.AbstractQuadratureAlgorithm
— Typeabstract type AbstractIntegralAlgorithm <: SciMLBase.AbstractSciMLAlgorithm
SciMLBase.AbstractOptimizationAlgorithm
— Typeabstract type AbstractOptimizationAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractSteadyStateAlgorithm
— Typeabstract type AbstractSteadyStateAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractODEAlgorithm
— Typeabstract type AbstractODEAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractSecondOrderODEAlgorithm
— Typeabstract type AbstractSecondOrderODEAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractRODEAlgorithm
— Typeabstract type AbstractRODEAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractSDEAlgorithm
— Typeabstract type AbstractSDEAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractDAEAlgorithm
— Typeabstract type AbstractDAEAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractDDEAlgorithm
— Typeabstract type AbstractDDEAlgorithm <: SciMLBase.AbstractDEAlgorithm
SciMLBase.AbstractSDDEAlgorithm
— Typeabstract type AbstractSDDEAlgorithm <: SciMLBase.AbstractDEAlgorithm