Developer Extension API
This page documents the version-controlled API intended for solver authors and OrdinaryDiffEq monorepo subpackages. These names are not application-facing OrdinaryDiffEq user API; user-facing DiffEqBase and OrdinaryDiffEqCore APIs are documented under the API section.
Do not build application code against these hooks. They exist so solver packages can extend common traits, controllers, interpolation hooks, and initialization protocols without depending on undocumented implementation details. Concrete per-algorithm caches and low-level nonlinear-solve helpers remain internal unless listed below; the listed automatic-switch caches and nonlinear-solver hooks are shared with sibling integrator packages.
DiffEqBase solver hooks
DiffEqBase.CallbackCache — Type
mutable struct CallbackCache{conditionType, signType}Preallocated scratch buffers used by the continuous-callback machinery. It holds the condition values and crossing signs evaluated during a step plus the per-component event masks for vector callbacks, so that locating and applying continuous-callback events is allocation-free. Integrators construct one (sized via max_vector_callback_length) when a problem has continuous callbacks.
DiffEqBase.EvalFunc — Type
EvalFunc(f)Callable wrapper used by DiffEqBase solve dispatch to pass an already-prepared function object through interfaces that expect a function-like value.
Fields
f: Wrapped callable object.
DiffEqBase.OrdinaryDiffEqTag — Type
OrdinaryDiffEqTagTag type used by DiffEqBase's no-recompile wrappers for OrdinaryDiffEq-family solver dispatch.
DiffEqBase.apply_callback! — Function
apply_callback!(integrator, callback, cb_time, prev_sign, event_idx)Apply a continuous callback at the determined event time.
For ContinuousCallback, the affect! or affect_neg! function is called based on the crossing direction (prev_sign):
prev_sign < 0(upcrossing):callback.affect!(integrator)is calledprev_sign > 0(downcrossing):callback.affect_neg!(integrator)is called
For VectorContinuousCallback, callback.affect! is called once with a length-callback.len view into the simultaneous_events::Vector{Int8} buffer from the callback cache:
callback.affect!(integrator, simultaneous_events)Each element of simultaneous_events encodes both whether the event triggered and its crossing direction:
0: event did not trigger+1: event triggered via upcrossing (condition went from negative to positive)-1: event triggered via downcrossing (condition went from positive to negative)
Multiple events may be nonzero simultaneously when they occur at the same time. The affect_neg! field is not called for VectorContinuousCallback; the user's affect! function should handle both crossing directions using the sign information.
DiffEqBase.apply_discrete_callback! — Function
apply_discrete_callback!(integrator, callback...)Apply discrete callback(s) to integrator: for each DiscreteCallback whose condition is true at the current (u, t), run its affect! and handle any saveat/save bookkeeping. Returns whether the discrete-callback set modified the integrator and whether a save was performed inside a callback, recursing over multiple callbacks while staying type-stable.
DiffEqBase.calculate_residuals — Function
calculate_residuals(ũ, u₀, u₁, α, ρ, internalnorm, t)Calculate element-wise residuals
\[\frac{ũ}{α+\max{|u₀|,|u₁|}*ρ}\]
calculate_residuals(E₁, E₂, u₀, u₁, α, ρ, δ, scalarnorm, t)Return element-wise residuals
\[\frac{δ E₁ + E₂}{α+\max{scalarnorm(u₀),scalarnorm(u₁)}*ρ}.\]
DiffEqBase.calculate_residuals! — Function
DiffEqBase.calculate_residuals!(out, ũ, u₀, u₁, α, ρ, thread = Serial())Save element-wise residuals
\[\frac{ũ}{α+\max{|u₀|,|u₁|}*ρ}\]
in out.
The argument thread determines whether internal broadcasting on appropriate CPU arrays should be serial (thread = Serial(), default) or use multiple threads (thread = Threaded()) when Julia is started with multiple threads.
calculate_residuals!(out, u₀, u₁, α, ρ, thread = Serial())Save element-wise residuals
\[\frac{u₁ - u₀}{α+\max{|u₀|,|u₁|}*ρ}\]
in out.
The argument thread determines whether internal broadcasting on appropriate CPU arrays should be serial (thread = Serial(), default) or use multiple threads (thread = Threaded()) when Julia is started with multiple threads.
calculate_residuals!(out, E₁, E₂, u₀, u₁, α, ρ, δ, scalarnorm, thread = Serial())Calculate element-wise residuals
\[\frac{δ E₁ + E₂}{α+\max{scalarnorm(u₀),scalarnorm(u₁)}*ρ}.\]
The argument thread determines whether internal broadcasting on appropriate CPU arrays should be serial (thread = Serial(), default) or use multiple threads (thread = Threaded()) when Julia is started with multiple threads.
DiffEqBase.check_prob_alg_pairing — Function
check_prob_alg_pairing(prob, alg) -> nothingValidate that alg is compatible with the problem type prob.
The check catches common dispatch mistakes before solver construction, including ODE algorithms passed to non-ODE problems, direct AD with algorithms that are not AD-compatible, and SDE noise-size mismatches.
Throws
ProblemSolverPairingError: If the problem and algorithm families do not match.DirectAutodiffError: If the initial condition uses dual numbers butalgis not autodifferentiable.NoiseSizeIncompatibilityError: If SDE noise dimensions are inconsistent.
DiffEqBase.default_factorize — Function
default_factorize(A)Factorize matrix A for out-of-place stiff solver paths.
The default implementation uses unchecked LU factorization and is intended as a solver-author extension hook.
DiffEqBase.finalize! — Function
finalize!(cb::CallbackSet, u, t, integrator::DEIntegrator)Recursively apply finalize! and return whether any modified u
DiffEqBase.find_callback_time — Function
find_callback_time(integrator, callback, callback_idx)Locate, within the current step, the time at which a single continuous callback's event occurs. Returns the event time together with the crossing sign, whether an event occurred, and the relevant event indices; for a VectorContinuousCallback it also records the per-component event mask. The event time is found by rootfinding on the callback condition.
DiffEqBase.find_first_continuous_callback — Function
find_first_continuous_callback(integrator, callbacks...)Scan the given continuous callbacks and return the bookkeeping for the one whose event fires earliest in the current step: the event time, crossing sign, whether an event occurred, the (vector-callback) event index, the identified callback index, and the number of callbacks. A generated method keeps the result type-stable for an arbitrary number of callbacks.
DiffEqBase.get_condition — Function
get_condition(integrator, callback, abst)Evaluate a continuous callback's condition function for integrator at the absolute time abst, interpolating the state when abst != integrator.t and respecting the callback's idxs/cache so the evaluation is allocation-free where possible. Used by the rootfinding that locates continuous-callback event times.
DiffEqBase.get_tstops — Function
get_tstops(integrator) -> AnyReturn the timestep-stop data structure owned by integrator.
Integrator implementations specialize this accessor so callback and jump-process machinery can inspect pending tstops without depending on integrator fields.
DiffEqBase.get_tstops_array — Function
get_tstops_array(integrator) -> AbstractVectorReturn the array-like storage containing pending timestep stops for integrator.
DiffEqBase.get_tstops_max — Function
get_tstops_max(integrator)Return the largest pending timestep stop for integrator.
DiffEqBase.initialize! — Function
initialize!(cb::CallbackSet, u, t, integrator::DEIntegrator)Recursively apply initialize! and return whether any modified u
DiffEqBase.max_vector_callback_length — Function
max_vector_callback_length(cs::CallbackSet)Return the VectorContinuousCallback in the callback set cs with the largest len, or nothing if the set contains none. Integrators use this to size the per-step CallbackCache buffers large enough for every vector callback.
DiffEqBase.max_vector_callback_length_int — Function
max_vector_callback_length_int(cs::CallbackSet)
max_vector_callback_length_int(callbacks...)Return the largest len among vector continuous callbacks.
Returns nothing when no vector continuous callback is present.
DiffEqBase.merge_problem_kwargs — Function
merge_problem_kwargs(prob; merge_callbacks=true, kwargs…)Merges kwargs stored in prob.kwargs with the provided kwargs, following DiffEq's standard merging rules:
- Problem kwargs are merged first
- Passed kwargs take precedence (i.e., they override problem kwargs)
- If
merge_callbacks=trueand both prob and kwargs have callbacks, they are merged into aCallbackSetrather than one overriding the other
Returns the merged kwargs as a Base.pairs.
This function is intended for use by problem types that override __solve or __init and need to manually handle kwargs merging that would normally be done by solve_call or init_call.
DiffEqBase.prepare_alg — Function
prepare_alg(alg, u0, p, prob) -> algReturn the algorithm object used for a solve after problem-dependent preparation.
This fallback returns alg unchanged. Solver packages specialize it when an algorithm needs to inspect the initial condition, parameters, or problem before dispatch reaches solve.
DiffEqBase.prob2dtmin — Function
prob2dtmin(prob; use_end_time = true)
prob2dtmin(tspan, onet, use_end_time)Compute the default minimum timestep implied by a problem or time span.
Arguments
prob: Differential-equation problem with atspanfield.tspan: Tuple-like time span.onet: Unit step value used to preserve units for non-floating time types.use_end_time: Whether the end of the time span contributes to the floating point spacing calculation.
Returns
- A nonnegative minimum timestep with units compatible with the time span.
DiffEqBase.stripunits — Function
stripunits(x)Return x with only its unit wrapper removed.
The default method returns x unchanged. Unitful extension packages specialize this function while preserving AD and uncertainty wrappers.
DiffEqBase.timedepentdtmin — Function
timedepentdtmin(integrator)
timedepentdtmin(t, dtmin)Return the time-dependent minimum timestep at the current time.
Floating-point times are bounded below by machine spacing at t; other time types use abs(dtmin).
Solver code-generation utilities
These macros are versioned for solver packages, not application code. Generated tableau bindings are local implementation details. Foldability and loop-policy annotations may only be applied when their documented effect assumptions hold.
DiffEqBase.@tight_loop_macros — Macro
@tight_loop_macros loop_exprApply the DiffEqBase loop policy to loop_expr. Solver packages use this macro around scalar stage loops so DiffEqBase can select common loop annotations without duplicating them in every solver implementation.
Arguments
loop_expr: loop expression to emit in the caller's scope, normally aforloop over state indices.
Returns
The escaped loop expression with the current DiffEqBase loop policy applied. The current policy preserves the expression unchanged; solver packages must not rely on that implementation detail.
Developer contract
The loop body must be valid under reordering and vectorization policies that a future DiffEqBase release may apply. Do not use the loop body for externally observable iteration ordering or cross-iteration dependencies. This is versioned solver-development API, not an application-facing loop macro.
Examples
using DiffEqBase: @tight_loop_macros
function add_one!(out, x)
@tight_loop_macros for i in eachindex(out, x)
@inbounds out[i] = x[i] + 1
end
return out
end
add_one!(zeros(2), [1.0, 2.0]) == [2.0, 3.0]OrdinaryDiffEqCore.@OnDemandTableauExtract — Macro
@OnDemandTableauExtract TableauType T
@OnDemandTableauExtract TableauType T T2Construct TableauType from one or two scalar types and bind each field of the constructed tableau to a same-named local variable in the invocation scope. Solver implementations use this macro to expose coefficient fields to stage code without storing a runtime tableau object.
Arguments
TableauType: concrete or parametric tableau type defined in the invoking module. Its field names determine the generated local bindings.T: scalar type passed as the first constructor argument.T2: optional scalar type passed as the second constructor argument, commonly used for time nodes.
Returns
An expression that constructs the tableau once and assigns every field value to a local variable with the corresponding field name.
Developer contract
TableauType must resolve in the invoking module and provide the selected constructor. Its field layout is part of the solver implementation using the macro. Invoke the macro inside a function before reading the generated names, and do not use those generated locals as application API.
Examples
using OrdinaryDiffEqCore: @OnDemandTableauExtract
struct ExampleTableau{T, T2}
weight::T
node::T2
end
ExampleTableau(::Type{T}, ::Type{T2}) where {T, T2} =
ExampleTableau(one(T), convert(T2, 1 // 2))
function coefficients(T, T2)
@OnDemandTableauExtract ExampleTableau T T2
return weight, node
end
coefficients(Float64, Float64) == (1.0, 0.5)OrdinaryDiffEqCore.@fold — Macro
@fold function_definitionDeclare function_definition foldable using Base.@assume_effects :foldable. OrdinaryDiffEq solver packages use this macro for deterministic tableau and coefficient constructors that the compiler may evaluate at compile time.
Arguments
function_definition: a function definition whose result depends only on its arguments and immutable global constants.
Returns
The escaped function definition wrapped in the Julia foldability annotation.
Developer contract
Only annotate functions that are deterministic, effect-free, and safe to evaluate or eliminate at compile time. Incorrect use can cause invalid compiler optimizations; functions that mutate external state, perform I/O, inspect mutable globals, or depend on task state must not use @fold.
Examples
using OrdinaryDiffEqCore: @fold
@fold function coefficient_pair(::Type{T}) where {T}
return convert(T, 1 // 2), one(T)
end
coefficient_pair(Float64) == (0.5, 1.0)Algorithm type hierarchy
Every solver subtypes one of these abstract algorithm types.
Minimal algorithm contract
Solver packages should subtype the narrowest applicable algorithm type, define the order, and then implement the cache and stepping hooks. The generic trait defaults are intentional: an explicit fixed-step method needs only the methods below before adding its cache and stepping implementation.
using OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm
struct MyEuler <: OrdinaryDiffEqAlgorithm end
OrdinaryDiffEqCore.alg_order(::MyEuler) = 1
OrdinaryDiffEqCore.isfsal(::MyEuler) = false
@assert !OrdinaryDiffEqCore.isadaptive(MyEuler())
@assert !OrdinaryDiffEqCore.isimplicit(MyEuler())The complete solver implementation then supplies:
alg_cache(alg, ...), returning anOrdinaryDiffEqConstantCacheorOrdinaryDiffEqMutableCache.initialize!(integrator, cache), initializing FSAL and cache state.perform_step!(integrator, cache, repeat_step = false), writing the candidate state tointegrator.uand the error estimate tointegrator.EEst.
Adaptive methods subtype OrdinaryDiffEqAdaptiveAlgorithm and must provide an embedded error estimate suitable for the controller. Implicit methods subtype OrdinaryDiffEqImplicitAlgorithm and must provide the nonlinear-solver cache and stage operations expected by the selected nlsolve configuration.
OrdinaryDiffEqCore.OrdinaryDiffEqAlgorithm — Type
OrdinaryDiffEqAlgorithm <: SciMLBase.AbstractODEAlgorithmAbstract supertype of every ODE algorithm defined in the OrdinaryDiffEq.jl ecosystem. A solver sublibrary defines a concrete algorithm by subtyping one of the more specific abstract types below (adaptive / implicit / exponential / …) rather than this root directly. Trait functions such as isadaptive, isimplicit, isfsal, and alg_order dispatch on this hierarchy.
Extension contract
A solver subtype must provide an alg_cache method and matching initialize! and perform_step! methods. It should also define alg_order and override only the traits whose behavior differs from the defaults. The cache type must be either an OrdinaryDiffEqConstantCache or an OrdinaryDiffEqMutableCache.
Example
using OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm
struct MyEuler <: OrdinaryDiffEqAlgorithm end
OrdinaryDiffEqCore.alg_order(::MyEuler) = 1
OrdinaryDiffEqCore.isfsal(::MyEuler) = falseOrdinaryDiffEqCore.OrdinaryDiffEqAdaptiveAlgorithm — Type
OrdinaryDiffEqAdaptiveAlgorithm <: OrdinaryDiffEqAlgorithmAbstract supertype for explicit ODE algorithms that support adaptive step-size control (they carry an embedded error estimate). Subtyping this makes isadaptive return true.
An adaptive algorithm must also provide an error estimate in perform_step! and a controller-compatible alg_order. Use OrdinaryDiffEqAdaptiveImplicitAlgorithm instead when each step solves a nonlinear system.
Example
using OrdinaryDiffEqCore: OrdinaryDiffEqAdaptiveAlgorithm
struct MyAdaptive <: OrdinaryDiffEqAdaptiveAlgorithm end
OrdinaryDiffEqCore.alg_order(::MyAdaptive) = 4
@assert OrdinaryDiffEqCore.isadaptive(MyAdaptive())OrdinaryDiffEqCore.OrdinaryDiffEqCompositeAlgorithm — Type
OrdinaryDiffEqCompositeAlgorithm <: OrdinaryDiffEqAlgorithmAbstract supertype for algorithms that dispatch between several sub-algorithms at runtime (see CompositeAlgorithm). Used by automatic stiffness switching and by the default solver.
OrdinaryDiffEqCore.OrdinaryDiffEqImplicitAlgorithm — Type
OrdinaryDiffEqImplicitAlgorithm <: OrdinaryDiffEqAlgorithmAbstract supertype for implicit ODE algorithms (those that solve a nonlinear system each step). Subtyping this makes isimplicit return true.
An implicit algorithm must provide the nonlinear-solver cache and stage methods expected by alg_cache, initialize!, and perform_step!. Its package should document the accepted nlsolve and linear-solver options and whether Jacobian reuse is supported by alg_can_repeat_jac.
Example
using OrdinaryDiffEqCore: OrdinaryDiffEqImplicitAlgorithm
struct MyImplicit <: OrdinaryDiffEqImplicitAlgorithm end
OrdinaryDiffEqCore.alg_order(::MyImplicit) = 2
@assert OrdinaryDiffEqCore.isimplicit(MyImplicit())OrdinaryDiffEqCore.OrdinaryDiffEqAdaptiveImplicitAlgorithm — Type
OrdinaryDiffEqAdaptiveImplicitAlgorithm <: OrdinaryDiffEqAdaptiveAlgorithmAbstract supertype for implicit ODE algorithms with adaptive step-size control.
OrdinaryDiffEqCore.OrdinaryDiffEqNewtonAlgorithm — Type
OrdinaryDiffEqNewtonAlgorithm <: OrdinaryDiffEqImplicitAlgorithmAbstract supertype for fixed-step implicit algorithms whose implicit stages are solved with a (quasi-)Newton nonlinear solver (see AbstractNLSolver).
OrdinaryDiffEqCore.OrdinaryDiffEqNewtonAdaptiveAlgorithm — Type
OrdinaryDiffEqNewtonAdaptiveAlgorithm <: OrdinaryDiffEqAdaptiveImplicitAlgorithmAbstract supertype for adaptive implicit algorithms solved with a Newton nonlinear solver. Distinguished from OrdinaryDiffEqNewtonAlgorithm by supporting Jacobian reuse across steps (alg_can_repeat_jac is true).
OrdinaryDiffEqCore.OrdinaryDiffEqRosenbrockAlgorithm — Type
OrdinaryDiffEqRosenbrockAlgorithm <: OrdinaryDiffEqImplicitAlgorithmAbstract supertype for fixed-step Rosenbrock (and Rosenbrock-W) methods, which use the Jacobian directly through linear solves rather than a Newton iteration.
OrdinaryDiffEqCore.OrdinaryDiffEqRosenbrockAdaptiveAlgorithm — Type
OrdinaryDiffEqRosenbrockAdaptiveAlgorithm <: OrdinaryDiffEqAdaptiveImplicitAlgorithmAbstract supertype for adaptive Rosenbrock / Rosenbrock-W methods.
OrdinaryDiffEqCore.NewtonAlgorithm — Type
NewtonAlgorithmUnion of OrdinaryDiffEqNewtonAlgorithm and OrdinaryDiffEqNewtonAdaptiveAlgorithm, i.e. every implicit algorithm that drives its stages with a Newton nonlinear solver. Used as a dispatch handle for the Newton/W-matrix machinery.
OrdinaryDiffEqCore.RosenbrockAlgorithm — Type
RosenbrockAlgorithmUnion of OrdinaryDiffEqRosenbrockAlgorithm and OrdinaryDiffEqRosenbrockAdaptiveAlgorithm, i.e. every Rosenbrock / Rosenbrock-W method.
OrdinaryDiffEqCore.OrdinaryDiffEqExponentialAlgorithm — Type
OrdinaryDiffEqExponentialAlgorithm <: OrdinaryDiffEqAlgorithmAbstract supertype for exponential integrators that evaluate matrix-function (e.g. exp, φ) actions of the (linearized) operator each step.
OrdinaryDiffEqCore.OrdinaryDiffEqAdaptiveExponentialAlgorithm — Type
OrdinaryDiffEqAdaptiveExponentialAlgorithm <: OrdinaryDiffEqAdaptiveAlgorithmAbstract supertype for exponential integrators with adaptive step-size control.
OrdinaryDiffEqCore.OrdinaryDiffEqLinearExponentialAlgorithm — Type
OrdinaryDiffEqLinearExponentialAlgorithm <: OrdinaryDiffEqExponentialAlgorithmAbstract supertype for exponential integrators specialized to (semi)linear problems u' = A u (+ B(t)) where the operator action can be applied directly.
OrdinaryDiffEqCore.ExponentialAlgorithm — Type
ExponentialAlgorithmUnion of OrdinaryDiffEqExponentialAlgorithm and OrdinaryDiffEqAdaptiveExponentialAlgorithm.
OrdinaryDiffEqCore.OrdinaryDiffEqAdamsVarOrderVarStepAlgorithm — Type
OrdinaryDiffEqAdamsVarOrderVarStepAlgorithm <: OrdinaryDiffEqAdaptiveAlgorithmAbstract supertype for variable-order variable-step Adams (multistep) methods. For these algorithms the current order lives on the cache, so get_current_alg_order / get_current_adaptive_order read cache.order rather than a fixed algorithm order.
OrdinaryDiffEqCore.DAEAlgorithm — Type
DAEAlgorithm <: SciMLBase.AbstractDAEAlgorithmAbstract supertype for fully-implicit DAE algorithms (solving f(du, u, p, t) = 0), e.g. DFBDF, DImplicitEuler. Distinct from the mass-matrix DAE path, which reuses the ODE algorithm types with a singular mass matrix.
OrdinaryDiffEqCore.OrdinaryDiffEqPartitionedAlgorithm — Type
OrdinaryDiffEqPartitionedAlgorithm <: OrdinaryDiffEqAlgorithmAbstract supertype for partitioned / dynamical-ODE algorithms (e.g. symplectic and Nyström methods) that split the state into position/velocity partitions.
OrdinaryDiffEqCore.OrdinaryDiffEqAdaptivePartitionedAlgorithm — Type
OrdinaryDiffEqAdaptivePartitionedAlgorithm <: OrdinaryDiffEqAdaptiveAlgorithmAbstract supertype for partitioned / dynamical-ODE algorithms with adaptive step-size control.
OrdinaryDiffEqCore.PartitionedAlgorithm — Type
PartitionedAlgorithmUnion of OrdinaryDiffEqPartitionedAlgorithm and OrdinaryDiffEqAdaptivePartitionedAlgorithm.
OrdinaryDiffEqCore.OrdinaryDiffEqImplicitSecondOrderAlgorithm — Type
OrdinaryDiffEqImplicitSecondOrderAlgorithm <: OrdinaryDiffEqImplicitAlgorithmAbstract supertype for implicit second-order (dynamical) ODE algorithms.
OrdinaryDiffEqCore.OrdinaryDiffEqAdaptiveImplicitSecondOrderAlgorithm — Type
OrdinaryDiffEqAdaptiveImplicitSecondOrderAlgorithm <: OrdinaryDiffEqAdaptiveImplicitAlgorithmAbstract supertype for adaptive implicit second-order (dynamical) ODE algorithms.
OrdinaryDiffEqCore.ImplicitSecondOrderAlgorithm — Type
ImplicitSecondOrderAlgorithmUnion of OrdinaryDiffEqImplicitSecondOrderAlgorithm and OrdinaryDiffEqAdaptiveImplicitSecondOrderAlgorithm.
SDE / RODE algorithm hierarchy
Subtyped by StochasticDiffEq.jl and defined in the core so shared machinery can dispatch on these algorithms.
OrdinaryDiffEqCore.StochasticDiffEqAlgorithm — Type
StochasticDiffEqAlgorithm <: SciMLBase.AbstractSDEAlgorithmAbstract supertype of every SDE algorithm in the StochasticDiffEq.jl ecosystem. Defined here in OrdinaryDiffEqCore so that the shared integrator machinery can dispatch on it.
OrdinaryDiffEqCore.StochasticDiffEqAdaptiveAlgorithm — Type
StochasticDiffEqAdaptiveAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for SDE algorithms supporting adaptive step-size control.
OrdinaryDiffEqCore.StochasticDiffEqCompositeAlgorithm — Type
StochasticDiffEqCompositeAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for composite (runtime-switching) SDE algorithms.
OrdinaryDiffEqCore.StochasticDiffEqNewtonAlgorithm — Type
StochasticDiffEqNewtonAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for fixed-step implicit SDE algorithms solved with a Newton nonlinear solver.
OrdinaryDiffEqCore.StochasticDiffEqNewtonAdaptiveAlgorithm — Type
StochasticDiffEqNewtonAdaptiveAlgorithm <: StochasticDiffEqAdaptiveAlgorithmAbstract supertype for adaptive implicit SDE algorithms solved with a Newton nonlinear solver.
OrdinaryDiffEqCore.StochasticDiffEqRODEAlgorithm — Type
StochasticDiffEqRODEAlgorithm <: SciMLBase.AbstractRODEAlgorithmAbstract supertype for random ODE (RODE) algorithms.
OrdinaryDiffEqCore.StochasticDiffEqRODEAdaptiveAlgorithm — Type
StochasticDiffEqRODEAdaptiveAlgorithm <: StochasticDiffEqRODEAlgorithmAbstract supertype for adaptive RODE algorithms.
OrdinaryDiffEqCore.StochasticDiffEqRODECompositeAlgorithm — Type
StochasticDiffEqRODECompositeAlgorithm <: StochasticDiffEqRODEAlgorithmAbstract supertype for composite (runtime-switching) RODE algorithms.
OrdinaryDiffEqCore.StochasticDiffEqJumpAlgorithm — Type
StochasticDiffEqJumpAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for SDE algorithms that additionally integrate jump terms.
OrdinaryDiffEqCore.StochasticDiffEqJumpAdaptiveAlgorithm — Type
StochasticDiffEqJumpAdaptiveAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for adaptive jump-SDE algorithms.
OrdinaryDiffEqCore.StochasticDiffEqJumpNewtonAdaptiveAlgorithm — Type
StochasticDiffEqJumpNewtonAdaptiveAlgorithm <: StochasticDiffEqJumpAdaptiveAlgorithmAbstract supertype for adaptive implicit (Newton) jump-SDE algorithms.
OrdinaryDiffEqCore.StochasticDiffEqJumpDiffusionAlgorithm — Type
StochasticDiffEqJumpDiffusionAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for jump-diffusion algorithms.
OrdinaryDiffEqCore.StochasticDiffEqJumpDiffusionAdaptiveAlgorithm — Type
StochasticDiffEqJumpDiffusionAdaptiveAlgorithm <: StochasticDiffEqAlgorithmAbstract supertype for adaptive jump-diffusion algorithms.
OrdinaryDiffEqCore.StochasticDiffEqJumpNewtonDiffusionAdaptiveAlgorithm — Type
StochasticDiffEqJumpNewtonDiffusionAdaptiveAlgorithm <: StochasticDiffEqJumpDiffusionAdaptiveAlgorithmAbstract supertype for adaptive implicit (Newton) jump-diffusion algorithms.
Composite algorithms and automatic switching
OrdinaryDiffEqCore.CompositeAlgorithm — Type
CompositeAlgorithm(algs, choice_function)A composite algorithm that chooses between multiple ODE solvers based on a user-defined choice function. This allows for adaptive algorithm switching based on problem characteristics or performance metrics.
Arguments
algs: Tuple or array of ODE algorithms to choose fromchoice_function: Function that determines which algorithm to use at each step
The choice function receives the integrator and should return an index indicating which algorithm to use. This enables sophisticated algorithm switching strategies based on solution behavior, step size, or other criteria.
OrdinaryDiffEqCore.CompositeCache — Type
CompositeCache(caches, choice_function, current) <: OrdinaryDiffEqCacheCache used by CompositeAlgorithm. Holds the tuple of sub-caches, the choice_function that selects the active algorithm, and the index current of the currently-active sub-cache.
Fields
caches: Tuple of caches for the component algorithms.choice_function: Function selecting the active component algorithm.current: Index of the active component cache.
Developer API
This is a solver-developer extension type for shared composite-cache machinery. End-user code should call solve and use solution APIs, rather than construct CompositeCache values or access cache fields.
OrdinaryDiffEqCore.AutoSwitchCache — Type
AutoSwitchCacheMutable state backing a stiffness-based AutoSwitch choice function. It counts consecutive stiff/nonstiff step diagnostics (count, successive_switches), stores the two candidate algorithms (nonstiffalg/stiffalg), the switching thresholds (maxstiffstep/maxnonstiffstep, nonstifftol/stifftol), and which branch is currently active (is_stiffalg, current). Called on the integrator to return the index of the algorithm to use for the next step.
OrdinaryDiffEqCore.isautoswitch — Function
isautoswitch(alg) -> BoolReturn whether alg is a composite algorithm whose choice function is an AutoSwitch stiffness detector.
OrdinaryDiffEqCore.default_autoswitch — Function
default_autoswitch(AS::AutoSwitchCache, integrator) -> IntChoose, for the automatic default solver, the index of the algorithm to use next given the auto-switch state AS and the current integrator. Extended by the default-solver sublibrary; the generic method is only a stub.
OrdinaryDiffEqCore.unwrap_alg — Function
unwrap_alg(integrator, is_stiff)
unwrap_alg(alg, is_stiff)Return the concrete algorithm actually driving the current step. For a non-composite algorithm this is alg itself; for a CompositeAlgorithm it selects the active constituent based on the current cache index or, for a two-member auto-switch pair, on the is_stiff flag.
OrdinaryDiffEqCore.isdefaultalg — Function
isdefaultalg(alg) -> BoolReturn whether alg is the automatic default algorithm wrapper. Used to route the stiffness auto-switching logic through its specialized default path.
OrdinaryDiffEqCore.is_composite_algorithm — Function
is_composite_algorithm(alg) -> BoolReturn whether alg dispatches between several sub-algorithms at runtime.
Arguments
alg: An algorithm instance.
Returns
true for an OrdinaryDiffEqCompositeAlgorithm, and false otherwise.
Rules
Sibling solver packages with their own composite-algorithm type must extend this trait to return true for that type.
OrdinaryDiffEqCore.is_composite_cache — Function
is_composite_cache(cache) -> BoolReturn whether cache isa CompositeCache, i.e. whether it wraps several sub-caches for a composite algorithm.
Developer API
This inspection trait is for solver implementations extending composite-cache machinery. End-user code should call solve and use solution APIs, rather than inspect cache constructors or fields.
OrdinaryDiffEqCore.is_constant_cache — Function
is_constant_cache(cache) -> BoolReturn whether cache is an out-of-place (OrdinaryDiffEqConstantCache) cache. For composite/default caches it reflects the active constituent cache.
Developer API
This inspection trait is for solver implementations extending cache machinery. End-user code should call solve and use solution APIs, rather than inspect cache constructors or fields.
Algorithm trait functions
Solver sublibraries specialize these to describe their algorithms.
SciMLBase.alg_order — Function
alg_order(alg) -> IntReturn the order of accuracy of alg. Solver sublibraries define this for each concrete algorithm; for a CompositeAlgorithm it is the maximum over the constituent algorithms.
OrdinaryDiffEqCore.alg_maximum_order — Function
alg_maximum_order(alg) -> IntReturn the maximum order the algorithm can attain. Equal to alg_order for fixed-order methods; for composite algorithms it is the maximum over the constituents.
OrdinaryDiffEqCore.alg_adaptive_order — Function
alg_adaptive_order(alg) -> IntReturn the order used for the adaptive error estimate of alg. The generic fallback is alg_order(alg) - 1; it is deliberately conservative because it tracks the realized error better than the embedded-estimate order.
OrdinaryDiffEqCore.alg_stability_size — Function
alg_stability_size(alg) -> RealReturn the (real-axis) linear stability region size of alg, used by stabilized/auto-switching heuristics to decide whether an explicit method is stable for the current step. Solver sublibraries define it per algorithm.
OrdinaryDiffEqCore.alg_extrapolates — Function
alg_extrapolates(alg) -> BoolReturn whether alg needs an extrapolated initial guess for its implicit/predictor stage (false by default). Algorithms that do set this to true so the integrator computes uprev2/extrapolant state for them.
OrdinaryDiffEqCore.alg_can_repeat_jac — Function
alg_can_repeat_jac(alg) -> BoolReturn whether alg may reuse a Jacobian/W factorization across steps rather than recomputing every step. true for adaptive Newton algorithms, false otherwise.
OrdinaryDiffEqCore.alg_autodiff — Function
alg_autodiff(alg)Return the automatic-differentiation choice (an ADTypes.jl AbstractADType) that alg uses to build Jacobians. Implicit-solver sublibraries define this for their algorithms; see also get_current_alg_autodiff for composite algorithms.
OrdinaryDiffEqCore.alg_difftype — Function
alg_difftype(alg)Return the finite-difference type (e.g. Val{:forward}) configured on alg's AutoFiniteDiff autodiff choice, used when differentiating by finite differences.
OrdinaryDiffEqCore.isfsal — Function
isfsal(alg) -> BoolReturn whether alg is a FSAL ("first same as last") method, i.e. the last stage derivative of one step equals the first of the next so it can be reused. Explicit RK methods are FSAL by default (true); the integrator reuses fsallast as the next fsalfirst accordingly.
OrdinaryDiffEqCore.fsal_typeof — Function
fsal_typeof(alg, rate_prototype)Return the type used to store the FSAL derivative for alg given a rate_prototype. Defaults to typeof(rate_prototype); overridden by algorithms whose FSAL slot differs from the ordinary rate type.
OrdinaryDiffEqCore.isimplicit — Function
isimplicit(alg) -> BoolReturn whether alg solves an implicit (nonlinear) system each step. false for explicit methods; true for implicit ones. For a CompositeAlgorithm it is true if any constituent is implicit.
SciMLBase.isadaptive — Function
isadaptive(alg) -> BoolReturn whether alg performs adaptive step-size control. true for algorithms subtyping an …Adaptive… abstract type, false otherwise.
OrdinaryDiffEqCore.isdtchangeable — Function
isdtchangeable(alg) -> BoolReturn whether alg allows the step size dt to change between steps (true by default). Multistep-style methods that require a fixed grid set this to false.
OrdinaryDiffEqCore.ismultistep — Function
ismultistep(alg) -> BoolReturn whether alg is a multistep method (uses solution history from more than the previous step). false by default.
OrdinaryDiffEqCore.dt_required — Function
dt_required(alg) -> BoolReturn whether alg requires the user to supply a dt (true by default). Only fully-adaptive or callback-driven algorithms may relax this.
OrdinaryDiffEqCore.uses_uprev — Function
uses_uprev(alg, adaptive::Bool) -> BoolReturn whether alg uses the previous step value uprev directly (as opposed to only via the FSAL history). true by default; used to decide whether the uprev cache slot must be maintained.
OrdinaryDiffEqCore.has_autodiff — Function
has_autodiff(alg) -> BoolReturn whether alg carries an autodiff field configuring Jacobian differentiation (false for explicit methods).
OrdinaryDiffEqCore.has_special_newton_error — Function
has_special_newton_error(alg) -> BoolReturn whether alg supplies its own Newton-iteration error estimate rather than the generic one (false by default).
OrdinaryDiffEqCore.has_dtnew_modification — Function
has_dtnew_modification(alg) -> BoolReturn whether alg post-processes the controller's proposed dtnew via a dtnew_modification hook (false by default).
OrdinaryDiffEqCore.has_stiff_interpolation — Function
has_stiff_interpolation(alg) -> BoolReturn whether alg provides a special interpolant for its stiff branch (false by default).
OrdinaryDiffEqCore.allows_null_u0 — Function
allows_null_u0(alg) -> BoolReturn whether alg supports an empty (zero-length) initial condition u0 (false by default).
OrdinaryDiffEqCore.isaposteriori — Function
isaposteriori(alg) -> BoolReturn whether alg uses a-posteriori (rather than embedded) error estimation (false by default).
OrdinaryDiffEqCore.isdiscretealg — Function
isdiscretealg(alg) -> BoolReturn whether alg is a discrete-time / map-iteration algorithm rather than a continuous ODE solver (false by default).
OrdinaryDiffEqCore.isdiscretecache — Function
isdiscretecache(cache) -> BoolReturn whether cache belongs to a discrete-time / map-iteration algorithm rather than a continuous ODE solver (false by default). Companion to isdiscretealg.
OrdinaryDiffEqCore.isdp8 — Function
isdp8(alg) -> BoolReturn whether alg is the DP8 method. Used to special-case its FSAL / dense handling (false by default).
OrdinaryDiffEqCore.isesdirk — Function
isesdirk(alg) -> BoolReturn whether alg is an ESDIRK (explicit-first-stage singly-diagonally-implicit Runge–Kutta) method (false by default).
OrdinaryDiffEqCore.isfirk — Function
isfirk(alg) -> BoolReturn whether alg is a fully-implicit Runge–Kutta (FIRK) method (false by default).
OrdinaryDiffEqCore.isnewton — Function
isnewton(nlsolver) -> BoolReturn whether the nonlinear solver nlsolver is a Newton-type solver (as opposed to a fixed-point / functional iteration), which determines whether a W-matrix is formed and updated.
OrdinaryDiffEqCore.isWmethod — Function
isWmethod(alg) -> BoolReturn whether alg is a W-method, i.e. it remains correct with an inexact (stale) Jacobian in its W matrix (false by default). Rosenbrock-W methods set this true.
OrdinaryDiffEqCore.is_mass_matrix_alg — Function
is_mass_matrix_alg(alg) -> BoolReturn whether alg supports solving mass-matrix ODEs/DAEs M u' = f (false by default; true for Rosenbrock and appropriate Newton methods).
OrdinaryDiffEqCore.issplit — Function
issplit(alg) -> BoolReturn whether alg treats the RHS as a split function (e.g. IMEX f = f1 + f2). false by default.
OrdinaryDiffEqCore.only_diagonal_mass_matrix — Function
only_diagonal_mass_matrix(alg) -> BoolReturn whether alg only supports diagonal (not general) mass matrices (false by default). Used to decide FSAL reevaluation.
OrdinaryDiffEqCore.standardtag — Function
standardtag(alg) -> BoolReturn whether alg uses the standard ForwardDiff tagging (a custom tag type for Dual numbers) when building Jacobians. Used by the differentiation machinery to pick the AD config.
OrdinaryDiffEqCore.concrete_jac — Function
concrete_jac(alg)Return the concrete_jac setting of alg: true/false forces whether a concrete Jacobian matrix is materialized, nothing lets the solver decide (e.g. based on the chosen linear solver).
OrdinaryDiffEqCore.fac_default_gamma — Function
fac_default_gamma(alg) -> BoolReturn whether the PredictiveController should apply the plain gamma safety factor without the Newton-iteration correction for alg (false by default; true for FIRK methods).
OrdinaryDiffEqCore.default_linear_interpolation — Function
default_linear_interpolation(alg, prob) -> BoolReturn whether the solver should default to (cheaper) linear interpolation instead of the algorithm's Hermite/dense interpolant for alg on prob. true for DAEs, discrete problems, and RODE/SDE problems.
Order / step-size / autodiff-config accessors
OrdinaryDiffEqCore.get_current_alg_order — Function
get_current_alg_order(alg, cache) -> IntReturn the order currently in effect for alg given its cache. Equal to alg_order for fixed-order methods; for variable-order methods (Adams/BDF) it reads the order stored on the cache.
OrdinaryDiffEqCore.get_current_adaptive_order — Function
get_current_adaptive_order(alg, cache) -> IntReturn the order used for the current step's adaptive error estimate given alg and its cache (order-aware analogue of alg_adaptive_order for variable-order methods).
OrdinaryDiffEqCore.get_current_alg_autodiff — Function
get_current_alg_autodiff(alg, cache)Return the autodiff choice active for the current step. Equals alg_autodiff(alg) for simple algorithms; for a CompositeAlgorithm it selects the currently-active constituent via cache.current.
OrdinaryDiffEqCore.get_chunksize — Function
get_chunksize(alg) -> ValReturn the ForwardDiff chunk size configured on alg's autodiff choice, as a Val. Val(0) means "let ForwardDiff choose".
OrdinaryDiffEqCore._get_fdtype — Function
_get_fdtype(AD)Return the finite-difference type parameter (e.g. Val{:forward}) of an AutoFiniteDiff type/instance AD.
OrdinaryDiffEqCore._get_fwd_chunksize — Function
_get_fwd_chunksize(AD) -> ValReturn, as a Val, the ForwardDiff chunk size encoded in the AutoForwardDiff type/instance AD (Val(0) when unspecified).
OrdinaryDiffEqCore._get_fwd_chunksize_int — Function
_get_fwd_chunksize_int(AD) -> IntReturn the ForwardDiff chunk size encoded in the AutoForwardDiff type/instance AD as a plain Int (0 when unspecified).
OrdinaryDiffEqCore._fixup_ad — Function
_fixup_ad(ad, args...)Internal helper that adjusts an autodiff choice ad to be consistent with the problem/solver context (e.g. disabling AD when it is not applicable). Returns the possibly-modified autodiff choice.
OrdinaryDiffEqCore.diffdir — Function
diffdir(integrator) -> IntReturn the finite-difference direction (+1 or -1) to use for time derivatives, chosen so the stencil stays inside the integration interval near an endpoint.
OrdinaryDiffEqCore.error_constant — Function
error_constant(integrator, order) -> RealReturn the leading error constant of the current method at the given order, used when scaling the local error estimate. Dispatches on integrator.alg.
OrdinaryDiffEqCore.constvalue — Function
constvalue(x)Strip any ForwardDiff/unit wrapper from x (or a type T) down to its underlying numeric value, taking the real part for Complex so that a scalar constant can be compared/used unambiguously. Used e.g. for eigenvalue estimates.
OrdinaryDiffEqCore.unitfulvalue — Function
unitfulvalue(x)Return the unit-stripped numeric value of x (delegates to SciMLBase.unitfulvalue). Used where a bare number is needed from a possibly Unitful quantity.
Enums and status types
OrdinaryDiffEqCore.COEFFICIENT_MULTISTEP — Constant
COEFFICIENT_MULTISTEPMethodType value for coefficient-form multistep (e.g. BDF) methods.
OrdinaryDiffEqCore.CompiledFloats — Type
CompiledFloatsUnion{Float32, Float64} — the floating-point element types for which the solvers provide fully precompiled specializations.
OrdinaryDiffEqCore.Convergence — Constant
ConvergenceNLStatus value (1) indicating the nonlinear solve converged.
OrdinaryDiffEqCore.DifferentialVarsUndefined — Type
DifferentialVarsUndefinedSentinel returned by get_differential_vars when the differential vs algebraic split cannot be determined (the mass matrix is not diagonal). In that case dense output falls back to linear interpolation.
OrdinaryDiffEqCore.DIRK — Constant
DIRKMethodType value for diagonally-implicit Runge–Kutta stage systems.
OrdinaryDiffEqCore.Divergence — Constant
DivergenceNLStatus value (-2) indicating the nonlinear iteration diverged.
OrdinaryDiffEqCore.FastConvergence — Constant
FastConvergenceNLStatus value (2) indicating the nonlinear solve converged quickly.
OrdinaryDiffEqCore.GLM — Constant
GLMMethodType value for general linear methods.
OrdinaryDiffEqCore.MethodType — Type
MethodType@enum classifying how an implicit algorithm forms its W = M/(γΔt) - J matrix and stage system. One of DIRK, COEFFICIENT_MULTISTEP, NORDSIECK_MULTISTEP, or GLM. The nonlinear solver uses it to scale γW appropriately in OrdinaryDiffEqNonlinearSolve.nlsolve!.
OrdinaryDiffEqCore.NLStatus — Type
NLStatus@enum reporting the outcome/convergence quality of a nonlinear solve, ordered from best to worst: FastConvergence (2), Convergence (1), SlowConvergence (0), VerySlowConvergence (-1), Divergence (-2). A non-positive value means the solve failed (OrdinaryDiffEqNonlinearSolve.nlsolvefail).
OrdinaryDiffEqCore.NORDSIECK_MULTISTEP — Constant
NORDSIECK_MULTISTEPMethodType value for Nordsieck-form multistep methods.
OrdinaryDiffEqCore.SlowConvergence — Constant
OrdinaryDiffEqCore.TryAgain — Constant
TryAgainAlias for SlowConvergence; a sentinel NLStatus signalling that the step should be retried (e.g. with a fresh Jacobian).
OrdinaryDiffEqCore.VerySlowConvergence — Constant
VerySlowConvergenceNLStatus value (-1) indicating very slow convergence; treated as a failure.
Nonlinear solver interface
The public nonlinear-solver algorithms are documented on the OrdinaryDiffEqCore API page. These core abstractions and W-matrix hooks are the solver-author extension points.
OrdinaryDiffEqCore.AbstractNLSolver — Type
AbstractNLSolver{algType, iip}Abstract supertype of the nonlinear solver object that implicit algorithms use to solve their implicit stage equations. Concrete subtypes (e.g. NLSolver in OrdinaryDiffEqNonlinearSolve) are built with OrdinaryDiffEqNonlinearSolve.build_nlsolver and driven with OrdinaryDiffEqNonlinearSolve.nlsolve!. The type parameters are the nonlinear-solver algorithm type and the in-place flag iip.
OrdinaryDiffEqCore.AbstractNLSolverAlgorithm — Type
AbstractNLSolverAlgorithmAbstract supertype of the algorithm objects that configure a nonlinear solver (e.g. NLNewton, NLFunctional, NLAnderson). Passed as the nlsolve keyword of an implicit algorithm and consumed internally by OrdinaryDiffEqNonlinearSolve.build_nlsolver.
OrdinaryDiffEqCore.AbstractNLSolverCache — Type
AbstractNLSolverCacheAbstract supertype of the mutable cache held by an AbstractNLSolver, storing the W-matrix, factorizations, residual buffers, and per-iteration state.
OrdinaryDiffEqCore.nlsolve_f — Function
nlsolve_f(f, alg)Return the RHS function that the nonlinear solver should use for alg. For split problems (e.g. IMEX) this selects the implicit part f.f1; otherwise it returns f unchanged.
OrdinaryDiffEqCore.get_W — Function
get_W(nlsolver)Return the W = M/(γΔt) - J matrix (or its factorization) held by the nonlinear solver's cache.
OrdinaryDiffEqCore.set_new_W! — Function
set_new_W!(nlsolver, val::Bool) -> BoolSet the flag recording whether a fresh W was just computed for this step and return val. Read via get_new_W! to decide whether to reset the Newton convergence estimate.
OrdinaryDiffEqCore.set_W_γdt! — Function
set_W_γdt!(nlsolver, W_γdt)Store the γΔt value at which the current W was formed and return it. A change in γΔt beyond get_new_W_γdt_cutoff triggers a W refactorization.
OrdinaryDiffEqCore.get_new_W_γdt_cutoff — Function
get_new_W_γdt_cutoff(nlsolver)Return the relative-change threshold on γΔt above which the nonlinear solver recomputes/refactorizes W rather than reusing the existing one.
OrdinaryDiffEqCore.isfirstcall — Function
isfirstcall(nlsolver) -> BoolReturn whether this is the first nonlinear solve of the current step (so a fresh W/initial guess is needed).
OrdinaryDiffEqCore.isfirststage — Function
isfirststage(nlsolver) -> BoolReturn whether the nonlinear solver is on the first implicit stage of a multi-stage method (used to decide predictor/W reuse).
OrdinaryDiffEqCore.isJcurrent — Function
isJcurrent(nlsolver, integrator) -> BoolReturn whether the Jacobian stored on the solver is current for the present integrator state (so it need not be recomputed).
OrdinaryDiffEqCore.resize_J_W! — Function
resize_J_W!(nlsolver, integrator, i)Resize the Jacobian and W matrices held by nlsolver to length i after the state size changes (e.g. from a resize! callback). No-op fallback.
OrdinaryDiffEqCore.resize_nlsolver! — Function
resize_nlsolver!(integrator, i)Resize the nonlinear solver's internal buffers to state length i after the state size changes. No-op fallback.
OrdinaryDiffEqCore.default_nlsolve — Function
default_nlsolve(alg, isinplace, u, initprob, autodiff = false, chunksize = Val(0))Return the nonlinear solver to use for a DAE-initialization problem initprob. If alg is already a concrete nonlinear-solve algorithm it is returned as-is; otherwise a sensible default is constructed from the arguments.
OrdinaryDiffEqNonlinearSolve driver hooks
These hooks are a version-controlled, developer-only contract for implicit solver packages. Cache constructors create an opaque nonlinear solver with build_nlsolver; step implementations mark stages, drive the solve, classify failure, and query optional workspace capabilities through the remaining functions. compute_step! and initial_η are extension points for sibling packages that implement an AbstractNLSolver subtype. The Anderson helpers are shared implementations, but their concrete workspace types and fields remain internal.
OrdinaryDiffEqNonlinearSolve.build_nlsolver — Function
build_nlsolver(alg, [nlalg,] u, uprev, p, t, dt, f, rate_prototype,
uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits, γ, c, [α,]
iip, verbose) -> AbstractNLSolverConstruct the nonlinear solver used by an implicit integrator algorithm.
Arguments
alg: the implicit ODE, DAE, or stochastic integrator algorithm that owns the stage equation and differentiation configuration.nlalg: optional nonlinear-solver algorithm. When omitted,alg.nlsolveis used.u,uprev: current- and previous-state prototypes used to size solver workspaces.p,t,dt: problem parameters, initial time, and initial step size.f: the ODE or DAE function used by the implicit stage equation.rate_prototype: derivative prototype used to size rate workspaces.uEltypeNoUnits,uBottomEltypeNoUnits,tTypeNoUnits: unitless scalar types chosen by the integrator cache constructor.γ,c: diagonal stage coefficient and stage abscissa.α: optional stage scaling; defaults to1.iip:Val(true)for an in-place problem andVal(false)for an out-of-place problem.verbose: the integrator's differential-equation verbosity configuration.
Returns
An OrdinaryDiffEqCore.AbstractNLSolver. Its concrete type and cache are implementation details; solver packages should retain the returned object and operate on it through the documented nonlinear-solver interfaces. The factory may retain aliases to the supplied prototypes as solver-owned workspace.
Failure behavior
Unsupported nonlinear-solver algorithms fail by dispatch. A homotopy nonlinear solver requested for a DAE throws ArgumentError; failures from Jacobian, linear-solver, or inner nonlinear-solver initialization propagate to the caller.
Solver-author usage
Implicit algorithm cache constructors call this factory once with their real algorithm and problem prototypes, then pass the returned object to nlsolve! for each stage. For example, a DIRK cache constructor uses the form
nlsolver = build_nlsolver(
alg, u, uprev, p, t, dt, f, rate_prototype,
uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits,
gamma, stage_abscissa, iip, verbose
)OrdinaryDiffEqNonlinearSolve.nlsolve! — Function
nlsolve!(
nlsolver::AbstractNLSolver, integrator, cache = nothing,
repeat_step = false
)Solve
\[dt⋅f(innertmp + γ⋅z, p, t + c⋅dt) + outertmp = z\]
where dt is the step size and γ and c are stage constants.
Arguments
nlsolver: a solver returned bybuild_nlsolver, or anotherOrdinaryDiffEqCore.AbstractNLSolverimplementation of this driver contract.integrator: the current differential-equation integrator.cache: the owning implicit algorithm's cache. Newton-type solvers require it forWupdates; fixed-point solvers may leave it asnothing.repeat_step: whether this solve is retrying the same integrator step after a rejection.
Mutation and return value
The solve updates the nonlinear iterate, convergence estimate, status, failure counters, and solver workspace. It may update the integrator state while forming a new W, and its postamble updates integrator statistics and force_stepfail. The return value is the result of the solver's SciMLBase.postamble! method; the solvers constructed by build_nlsolver return the converged stage increment z.
Failure behavior
Non-convergence is recorded in the solver status rather than thrown: inspect it with nlsolvefail. A stale-Jacobian failure is retried once with a fresh Jacobian. Calling a Newton-type solver without cache throws ArgumentError, and exceptions raised by residual, Jacobian, or linear-solver evaluations propagate.
Extension contract
Custom nonlinear solvers extend compute_step! and initial_η, and provide the AbstractNLSolver state queried by the documented OrdinaryDiffEqCore nonlinear-solver hooks. Candidate acceptance and finalization are dispatched through OrdinaryDiffEqCore.apply_step! and SciMLBase.postamble!.
Whether innertmp and outertmp is used for the evaluation is controlled by setting nlsolver.method. In both cases the variable name is actually nlsolver.tmp.
OrdinaryDiffEqNonlinearSolve.nlsolvefail — Function
nlsolvefail(nlsolver::AbstractNLSolver) -> Bool
nlsolvefail(status::NLStatus) -> BoolReturn whether a nonlinear solve failed.
Arguments
nlsolver: a nonlinear solver whose current outcome is stored in itsstatusproperty.status: anOrdinaryDiffEqCore.NLStatusto classify directly.
Returns
true for a non-positive status (SlowConvergence, VerySlowConvergence, or Divergence) and false for Convergence or FastConvergence. Sibling solver packages use this predicate after nlsolve! to decide whether to abandon the current integrator step.
OrdinaryDiffEqNonlinearSolve.markfirststage! — Function
markfirststage!(nlsolver::AbstractNLSolver) -> NothingMark nlsolver as being on the first implicit stage of the current integrator step.
This mutates the solver's stage state when its algorithm tracks one and is a no-op otherwise. Predictor and W-reuse logic may query the marker through OrdinaryDiffEqCore.isfirststage. The marker is cleared by nlsolve!'s postamble after a solve.
OrdinaryDiffEqNonlinearSolve.du_alias_or_new — Function
du_alias_or_new(nlsolver::AbstractNLSolver, rate_prototype)Return a derivative buffer compatible with rate_prototype.
Arguments
nlsolver: the nonlinear solver that may already own a reusable derivative workspace.rate_prototype: the integrator's derivative prototype and the template for a newly allocated buffer.
Returns
The solver-owned derivative workspace when one is available; otherwise zero(rate_prototype). The returned object is mutable solver workspace when it aliases an existing buffer, so callers may use it while constructing their integrator cache but must not retain it beyond the nonlinear solver's lifetime.
OrdinaryDiffEqNonlinearSolve.can_smooth_est — Function
can_smooth_est(nlsolver::AbstractNLSolver) -> BoolReturn whether nlsolver can reuse its current W linear solve for an implicit method's smoothed error estimate.
This capability query does not expose the nonlinear solver's cache or factorization representation. A solver-author caller must use the ordinary embedded estimate when this function returns false.
OrdinaryDiffEqNonlinearSolve.compute_step! — Function
compute_step!(nlsolver, integrator[, γW]) -> residual_normCompute one candidate nonlinear iteration and return its scaled residual or increment norm.
Arguments
nlsolver: the nonlinear solver whose candidate iterate and workspace are updated.integrator: the differential-equation integrator that supplies the current state, tolerances, right-hand side, and statistics.γW: the currentγ * dtscaling for Newton-type methods. Fixed-point methods omit this argument.
Returns
A finite, nonnegative norm when a candidate iteration was computed. Returning a non-finite value reports divergence to nlsolve!. This function mutates the candidate iterate and its workspace and may update the integrator's nonlinear evaluation statistics. The shared driver calls OrdinaryDiffEqCore.apply_step! after accepting the candidate.
Solver packages that subtype OrdinaryDiffEqCore.AbstractNLSolver extend this function to participate in the shared nlsolve! convergence loop.
OrdinaryDiffEqNonlinearSolve.initial_η — Function
initial_η(nlsolver, integrator) -> ηReturn the initial convergence-rate estimate η for a fresh nonlinear solve. Functional/Anderson solvers reuse the previous ηold; the Newton solver method derives it from the tolerance. The return value must be a finite nonnegative number compatible with the integrator tolerances.
Solver packages that define an OrdinaryDiffEqCore.AbstractNLSolver subtype extend this function when their initial estimate differs from the default tolerance-based rule. The function does not mutate the solver or integrator and is consumed by nlsolve!.
OrdinaryDiffEqNonlinearSolve.anderson — Function
anderson(z, cache) -> accelerated_zReturn an Anderson-accelerated iterate for the fixed-point iteration z = g(z).
z is the current iterate and cache is the Anderson workspace initialized by the calling nonlinear solver. The function updates the workspace's iteration history but returns the accelerated state rather than mutating z. Solver packages that reuse this helper own the workspace's construction and lifetime; no concrete Anderson cache type is part of this API.
Linear-algebra failures while updating or solving the history least-squares system propagate to the caller.
OrdinaryDiffEqNonlinearSolve.anderson! — Function
anderson!(z, cache) -> NothingUpdate the current iterate z of the fixed-point iteration z = g(z) in place using Anderson acceleration.
cache is the Anderson workspace initialized by the calling nonlinear solver. Both z and the workspace history are mutated. Solver packages that reuse this helper own the workspace's construction and lifetime; no concrete Anderson cache type is part of this API. Linear-algebra failures propagate to the caller.
Jacobian / W-matrix / differentiation configuration
Provided by OrdinaryDiffEqDifferentiation.
OrdinaryDiffEqDifferentiation.build_J_W — Function
build_J_W(alg, u, uprev, p, t, dt, f, jac_config, ::Type{uEltypeNoUnits}, ::Val{iip}) -> (J, W)Allocate and return the Jacobian J and the linear-system matrix W = M/(γΔt) - J (or their operator/factorization prototypes) for algorithm alg. Handles user-provided jac_prototype / W_prototypeSciMLOperators, the mass matrix M, and the linear vs nonlinear function case; the resulting W carries the eltype that calc_W/calc_W! will later produce. Val{iip} selects the in-place branch.
OrdinaryDiffEqDifferentiation.build_uf — Function
build_uf(alg, nf, t, p, ::Val{iip})Return the wrapper object used to differentiate the RHS nf with respect to the state: a UJacobianWrapper for the in-place case (Val{true}) or a UDerivativeWrapper for the out-of-place case (Val{false}). Carries the current t and p, which are updated before each Jacobian evaluation.
OrdinaryDiffEqDifferentiation.build_jac_config — Function
build_jac_config(alg, f, uf, du1, uprev, u, tmp, du2)Construct the differentiation configuration used to compute the state Jacobian of f via jacobian! (a DifferentiationInterface preparation, or nothing when the problem supplies its own jac/Wfact). For finite differencing it returns forward/backward-direction configs so diffdir can pick the in-domain stencil.
OrdinaryDiffEqDifferentiation.build_grad_config — Function
build_grad_config(alg, f, tf, du1, t)Construct the differentiation configuration used to compute the time derivative ∂f/∂t (needed by Rosenbrock methods) via the tf time-gradient wrapper. Returns nothing when f provides an analytic tgrad; for finite differencing it returns forward/backward-direction configs.
OrdinaryDiffEqDifferentiation.calc_J — Function
calc_J(integrator, cache, next_step::Bool = false)Return a new Jacobian object.
If integrator.f has a custom Jacobian update function, then it will be called. Otherwise, either automatic or finite differencing will be used depending on the uf object of the cache. If next_step, then it will evaluate the Jacobian at the next step.
OrdinaryDiffEqDifferentiation.calc_J! — Function
calc_J!(J, integrator, cache, next_step::Bool = false) -> JUpdate the Jacobian object J.
If integrator.f has a custom Jacobian update function, then it will be called. Otherwise, either automatic or finite differencing will be used depending on the cache. If next_step, then it will evaluate the Jacobian at the next step.
OrdinaryDiffEqDifferentiation.calc_tderivative — Function
calc_tderivative(integrator, cache) -> dTOut-of-place counterpart of calc_tderivative!: compute and return the time derivative ∂f/∂t at the current step.
OrdinaryDiffEqDifferentiation.calc_tderivative! — Function
calc_tderivative!(integrator, cache, dtd1, repeat_step)Compute the time derivative dT = ∂f/∂t in place (using the analytic tgrad when available, else autodiff/finite differences) and store the Rosenbrock right-hand side linsolve_tmp = fsalfirst + dtd1·dT on the cache. Skipped when repeat_step is true.
OrdinaryDiffEqDifferentiation.calc_rosenbrock_differentiation — Function
calc_rosenbrock_differentiation(integrator, cache, dtgamma, repeat_step)Non-mutating (OOP) version of calc_rosenbrock_differentiation!. Returns (dT, W) where dT is the time derivative and W is the factorized system matrix. Supports Jacobian reuse for W-methods via jac_reuse in the cache.
OrdinaryDiffEqDifferentiation.calc_rosenbrock_differentiation! — Function
calc_rosenbrock_differentiation!(integrator, cache, dtd1, dtgamma, repeat_step) -> new_WCompute (in place) the Jacobian, the factorized W = M/(dtgamma) - J, and the time derivative needed by a Rosenbrock step, honoring Jacobian reuse for W-methods. Returns whether a fresh W was formed. Skips the work on a repeated step.
OrdinaryDiffEqDifferentiation.jacobian! — Function
jacobian!(J, f, x, fx, integrator, jac_config)Compute the Jacobian of f at x into J in place, using the AD backend or finite differences configured in jac_config (respecting the finite-difference direction). fx is a preallocated RHS buffer. No-op for an empty state.
OrdinaryDiffEqDifferentiation.jacobian2W! — Function
jacobian2W!(W, mass_matrix, dtgamma, J) -> nothingForm the linear-system matrix W = M/dtgamma - J in place from the Jacobian J and mass matrix M (with M = I handled specially), using scalar-indexed, broadcast, or allocating paths depending on the array type (dense, sparse, GPU).
OrdinaryDiffEqDifferentiation.update_W! — Function
update_W!(integrator, cache, dtgamma, repeat_step, newJW = nothing)
update_W!(nlsolver, integrator, cache, dtgamma, repeat_step, newJW = nothing)Recompute/refactorize the nonlinear solver's W = M/dtgamma - J when needed for a Newton solve, deciding whether the Jacobian and/or the factorization must be refreshed (newJW can force the decision). No-op for non-Newton solvers.
OrdinaryDiffEqDifferentiation.resize_jac_config! — Function
resize_jac_config!(cache, integrator)Resize the Jacobian differentiation configuration on cache to match a changed state length (e.g. after a resize! callback), rebuilding the AD/finite-difference configs for the new size.
OrdinaryDiffEqDifferentiation.resize_grad_config! — Function
resize_grad_config!(cache, integrator)Resize the time-derivative differentiation configuration on cache to match a changed state length.
OrdinaryDiffEqDifferentiation.dolinsolve — Function
dolinsolve(integrator, linsolve; A = nothing, linu = nothing, b = nothing, reltol = …) -> linresSolve the linear system with the LinearSolve.jl cache linsolve, optionally resetting its matrix A, unknown linu, right-hand side b, and tolerance reltol (see set_linear_reltol!). Charges stats.nf for the Jacobian-vector products the solve applied (see drain_jvp_count!) and returns the LinearSolve result.
OrdinaryDiffEqDifferentiation.wrapprecs — Function
wrapprecs(linsolver, W, weight) -> linsolverAttach a diagonal (weight-based) left/right preconditioner to linsolver when it supports precs and none was supplied, returning the reconfigured solver; otherwise return linsolver unchanged.
OrdinaryDiffEqDifferentiation.default_krylov_warm_start — Function
default_krylov_warm_start(linsolver) -> linsolverResolve a Krylov linear solver left at LinearSolve.WarmStart.Auto to the mode appropriate for a Newton-based integrator, LinearSolve.WarmStart.Hegedus (Hegedüs-scaled reuse of the previous solution — the recommended mode for the sequence of correlated preconditioned solves inside a Newton iteration).
Only the Auto default is resolved: an explicit WarmStart.None/Previous/ Hegedus or a non-Krylov solver is returned unchanged. This is called on the Newton nonlinear-solver path only; Rosenbrock/W-method integrators never call it, so their Auto solver stays a cold start (warm starting is unsafe there — no outer Newton iteration absorbs the within-tolerance stage-solve perturbation).
Warm starting the Newton path is only sound because LinearSolve discards a Hegedüs guess that cannot reduce the residual (SciML/LinearSolve.jl#1123). The guess is a previous Newton increment, and those converge to round-off; without that check the rescaling amplified last-ulp input differences by ~1e13 (SciML/OrdinaryDiffEq.jl#4034). The [compat] floor on LinearSolve is what guarantees the check is present.
OrdinaryDiffEqDifferentiation.is_always_new — Function
is_always_new(alg) -> BoolReturn whether alg (or its nonlinear-solver algorithm) requests a fresh W computed on every solve, i.e. its always_new field is true (false when the field is absent).
OrdinaryDiffEqDifferentiation.islinearfunction — Function
islinearfunction(integrator) -> Tuple{Bool, Bool}return the tuple (is_linear_wrt_odealg, islinearodefunction).
islinearfunction(f, alg) -> Tuple{Bool, Bool}return the tuple (is_linear_wrt_odealg, islinearodefunction).
OrdinaryDiffEqDifferentiation.issuccess_W — Function
issuccess_W(W) -> BoolReturn whether the factorized system matrix W is nonsingular / the factorization succeeded. For a Factorization it forwards to LinearAlgebra.issuccess; for a scalar W it checks !iszero(W); otherwise it returns true.
OrdinaryDiffEqDifferentiation.drain_jvp_count! — Function
drain_jvp_count!(integrator, alg, W) -> nothingAdd the Jacobian-vector products accumulated in W's JVP operator to integrator.stats.nf and reset the tally, so each product is counted once no matter how many Ws share the operator.
Nothing is counted when no JVPCache is involved: a W whose Jacobian is a concrete matrix or a user-supplied MatrixOperator applies a stored matrix and evaluates f zero times.
OrdinaryDiffEqDifferentiation.jvp_counter — Function
jvp_counter(W) -> JVPCache or nothingThe JVPCache whose products W applies, or nothing when W costs no RHS evaluations per product. A WOperator uses its jacvec when it has one and its J otherwise, which is what LinearAlgebra.mul! does with it.
OrdinaryDiffEqDifferentiation.set_linear_reltol! — Function
set_linear_reltol!(linsolve, reltol) -> linsolvePoint the LinearSolve.jl cache linsolve at relative tolerance reltol.
SciMLBase.solve!(::LinearCache, alg; kwargs...) takes its tolerances from the cache and drops any handed to it as keywords, so solve!(linsolve; reltol) sets nothing and an iterative solve keeps running at LinearSolve's sqrt(eps) default however tight or loose the integrator is. LinearSolve.update_tolerances! is the entry point that does take effect.
Solvers that need a concrete A are left alone: a factorization has no tolerance to set and update_tolerances! throws for one. A non-scalar reltol (per-component tolerances) is left alone too — LinearCache holds a single scalar tolerance and the iterative solvers compare against a scalar bound.
Integrator step, cache construction, and initialization hooks
The cache hierarchy and @cache macro are developer API for solver packages that implement new algorithms. They define internal solver storage, not application-facing cache objects.
The StochasticDiffEq*Cache trio is the SDE/RODE analogue, subtyped by the StochasticDiffEq.jl solver sublibraries.
OrdinaryDiffEqCore.OrdinaryDiffEqCache — Type
OrdinaryDiffEqCache <: SciMLBase.DECacheAbstract supertype of every solver cache. A cache holds the per-solve scratch state (stage values, temporaries, tableau, nonlinear solver, …) associated with an algorithm. Concrete caches are built by alg_cache and subtype either OrdinaryDiffEqConstantCache or OrdinaryDiffEqMutableCache.
OrdinaryDiffEqCore.OrdinaryDiffEqConstantCache — Type
OrdinaryDiffEqConstantCache <: OrdinaryDiffEqCacheAbstract supertype for out-of-place ("constant") caches used when the state is immutable (e.g. Numbers, StaticArrays). These allocate fresh values each step instead of mutating in place. is_constant_cache returns true for them.
OrdinaryDiffEqCore.OrdinaryDiffEqMutableCache — Type
OrdinaryDiffEqMutableCache <: OrdinaryDiffEqCacheAbstract supertype for in-place ("mutable") caches used when the state is a mutable array. Their scratch fields are preallocated and reused each step.
OrdinaryDiffEqCore.StochasticDiffEqCache — Type
StochasticDiffEqCache <: SciMLBase.DECacheAbstract supertype of every SDE/RODE solver cache. Analogue of OrdinaryDiffEqCache for the StochasticDiffEq.jl solvers; concrete caches subtype StochasticDiffEqConstantCache or StochasticDiffEqMutableCache.
OrdinaryDiffEqCore.StochasticDiffEqConstantCache — Type
StochasticDiffEqConstantCache <: StochasticDiffEqCacheAbstract supertype for out-of-place SDE/RODE caches (immutable state).
OrdinaryDiffEqCore.StochasticDiffEqMutableCache — Type
StochasticDiffEqMutableCache <: StochasticDiffEqCacheAbstract supertype for in-place SDE/RODE caches (preallocated, mutated in place).
OrdinaryDiffEqCore.DefaultCache — Type
DefaultCache <: OrdinaryDiffEqCacheSpecialized composite cache used by the automatic default solver. It lazily holds up to six candidate sub-caches (cache1…cache6) constructed on demand from args, together with the choice_function and the current selected index, avoiding compilation of every candidate up front.
OrdinaryDiffEqCore.strip_cache — Function
strip_cache(cache)Return a lightweight copy of cache with all fields set to nothing, used by SciMLBase.strip_interpolation to drop the (potentially large) working buffers from a solution's interpolation object before serialization. Has a special path for DefaultCache.
Developer API
Solver extensions may specialize this hook for their cache types. End-user code should call solve and use solution APIs, rather than construct caches or depend on cache fields and their serialized representation.
OrdinaryDiffEqCore.@cache — Macro
@cache struct MyCache ... endMacro used to define a mutable solver cache. It emits the given struct definition and additionally generates a full_cache(c::MyCache) method returning the tuple of its resizable buffer fields (those typed uType, rateType, kType, uNoUnitsType, or the du/dual_du of a DiffCacheType). That full_cache tuple is what the resize!/deleteat! integrator interface iterates over when the state length changes.
OrdinaryDiffEqCore.alg_cache — Function
alg_cache(alg, u, rate_prototype, uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{iip}, verbose)Construct and return the internal solver cache for alg.
This is a developer extension point for solver packages. Each solver sublibrary defines a method for its algorithm type that allocates stage buffers, tableau data, nonlinear-solver state, and other per-solve scratch storage. The Val{iip} argument selects the in-place or out-of-place cache branch.
Examples
Solver packages extend alg_cache for their algorithm type:
import OrdinaryDiffEqCore: alg_cache
function alg_cache(
alg::MyAlgorithm, u, rate_prototype, ::Type{uEltypeNoUnits},
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
dt, reltol, p, calck, ::Val{iip}, verbose
) where {
uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits, iip,
}
return MyAlgorithmCache(u, rate_prototype)
endOrdinaryDiffEqCore.get_fsalfirstlast — Function
get_fsalfirstlast(cache, u)Return the (fsalfirst, fsallast) derivative buffers for cache, allocating zeros of the shape of u for constant caches. Used to set up FSAL storage when initializing the integrator.
OrdinaryDiffEqCore.get_fresh_jacobian — Function
get_fresh_jacobian(integrator, cache)Return a Jacobian suitable for numerical-instability diagnostics. Cache-specific packages may specialize this hook when the stored Jacobian is unavailable or stale. Diagnostic evaluation must not increment solver work statistics.
OrdinaryDiffEqCore.perform_step! — Function
IRI1 perform_step! implementation (constant cache, out-of-place)
This implements a drift-implicit weak order 2 stochastic Runge-Kutta method based on the RI1 scheme with theta-method implicitization of the drift.
IRI1 perform_step! implementation (mutable cache, in-place)
perform_step!(integrator, cache, repeat_step = false)Advance the integrator by one step using algorithm cache, writing the proposed new state into integrator.u and the error estimate into integrator.EEst. This is the core routine each solver sublibrary implements for its cache type; repeat_step indicates the step is being retried after a rejection.
OrdinaryDiffEqCore.apply_step! — Function
apply_step!(integrator)Commit an accepted step: copy u into uprev, advance dt to the proposed step size (if allowed), refresh the FSAL derivative, shorten dt to the next tstop, and accept any noise process. Called by the integrator loop after a step is accepted.
SciMLBase.check_error! — Method
check_error!(integrator)Run check_error, store the resulting code in integrator.sol.retcode, and return that code.
When the code is not ReturnCode.Success, the common implementation also calls the solver's postamble! hook so pending bookkeeping and finalization are performed before the solve exits. A successful check updates the return code but does not finalize the integrator.
SciMLBase.check_error — Method
check_error(integrator)Inspect integrator and return the ReturnCode that describes whether integration may continue.
The common implementation preserves an existing terminal return code and checks for a NaN step size, iteration limits, a step size at or below dtmin, a user-supplied instability predicate, and failed nonlinear steps. It does not mutate integrator.sol.retcode; use check_error! when the solution must be updated. Concrete integrators may specialize the checks while preserving the return-code contract.
Diagnostics for detected failures are emitted through report_integrator_failure, which the solver stack implements; this function only performs detection.
SciMLBase.last_step_failed — Method
last_step_failed(integrator) -> BoolReturn whether the preceding attempted solver step failed to converge.
Concrete differential-equation integrators may specialize this hook when their step controller tracks a recoverable failed attempt. check_error uses it to convert a non-adaptive repeated failure into ReturnCode.ConvergenceFailure. The default is false.
This is a versioned integrator implementation hook. Application code should inspect a solve result's return code instead.
Example
SciMLBase.last_step_failed(integrator::MyIntegrator) = integrator.last_step_failedSciMLBase.postamble! — Function
postamble!(integrator)Finalize a differential-equation integrator after its solve loop terminates. Solver packages specialize this hook to perform final bookkeeping that must run on normal completion and on an error return. The default generic function has no method; an integrator implementation that requires finalization must provide one.
Application code must not call this hook. Use solve!, step!, or terminate! to control an integrator lifecycle.
Example
function SciMLBase.postamble!(integrator::MyIntegrator)
flush_pending_save!(integrator)
return nothing
endOrdinaryDiffEqCore.set_discontinuity — Function
set_discontinuity(integrator) -> dtReturn the sub-step Δt at which a continuous callback's root lies within the current step (a discontinuity to stop at), or a negative value if there is none in (0, 1)·dt.
OrdinaryDiffEqCore.increment_accept! — Function
increment_accept!(stats)Increment the accepted-step counter stats.naccept by one.
OrdinaryDiffEqCore.increment_reject! — Function
increment_reject!(stats)Increment the rejected-step counter stats.nreject by one.
OrdinaryDiffEqCore.increment_nf! — Function
increment_nf!(stats, amt = 1)Increment the RHS-evaluation counter stats.nf by amt.
OrdinaryDiffEqCore.ode_determine_initdt — Function
ode_determine_initdt(u0, t, tdir, dtmax, abstol, reltol, internalnorm, prob, integrator) -> dtCompute an automatic initial step size for prob using the standard Hairer–Nørsett–Wanner heuristic (based on the norms of f and its derivative at u0), respecting dtmax, the tolerances, and the integration direction tdir.
OrdinaryDiffEqCore._determine_initdt — Function
_determine_initdt(integrator) -> dtConvenience wrapper that calls ode_determine_initdt with the fields of integrator (state, tolerances, norm, problem).
OrdinaryDiffEqCore._ode_init — Function
_ode_init(prob, alg, timeseries_init = (), ts_init = (), ks_init = (); kwargs...)Internal implementation of __init for ODE/DAE/SDE/RODE problems. This is separated from __init so that SDE packages can call it directly, bypassing method dispatch (which would otherwise re-enter SDE's more specific __init).
OrdinaryDiffEqCore._initialize_dae! — Function
_initialize_dae!(integrator, prob, alg, ::Val{iip})Run the DAE / mass-matrix initialization: adjust u0 (and du0) so the algebraic constraints and initialization equations of prob are satisfied to tolerance, using the initialization algorithm alg (e.g. CheckInit, BrownFullBasicInit, OverrideInit). Val{iip} selects the in-place branch.
OrdinaryDiffEqCore.find_algebraic_vars_eqs — Function
find_algebraic_vars_eqs(M)Find algebraic variables (zero columns) and algebraic equations (zero rows) from mass matrix. Returns (algebraic_vars, algebraic_eqs) as boolean arrays (true = algebraic).
Works on CPU and GPU arrays. Sparse specialization (O(nnz)) is provided in OrdinaryDiffEqCoreSparseArraysExt.
OrdinaryDiffEqCore.get_differential_vars — Function
get_differential_vars(f, idxs, timeseries::uType)Returns an array of booleans for which values are the differential variables vs algebraic variables. Returns nothing for the cases where all variables are differential variables. Returns DifferentialVarsUndefined if it cannot be determined (i.e. the mass matrix is not diagonal).
OrdinaryDiffEqCore.handle_callback_modifiers! — Function
handle_callback_modifiers!(integrator)Hook invoked after a callback modifies the integrator state, letting the algorithm react (e.g. re-evaluate FSAL). No-op for a plain ODEIntegrator; extended by integrators that need to respond to callback-induced changes.
OrdinaryDiffEqCore.resolve_stage_step_limiters — Function
resolve_stage_step_limiters(alg, stage_limiter, step_limiter, verbose_spec)Resolve the effective (stage_limiter!, step_limiter!) from the solve-level stage_limiter/step_limiter keywords. A non-trivial per-algorithm stage_limiter!/step_limiter! field is still honored (with a deprecation warning) when the matching keyword is not supplied. alg should be the concrete method (e.g. unwrapped from MethodOfSteps). Supplying stage_limiter to a method for which has_stage_limiter is false triggers the stage_limiter_unused verbosity toggle, which defaults to ErrorLevel (it errors) and can be lowered to WarnLevel/Silent to allow it.
OrdinaryDiffEqCore.trivial_limiter! — Function
trivial_limiter!(u, integrator, p, t)No-op stage/step limiter used when no solve-level limiter is supplied.
OrdinaryDiffEqCore.DEOptions — Type
DEOptionsMutable container of resolved common solver options, stored on a running integrator as integrator.opts.
Fields
abstol,reltol,internalnorm, andinternalopnormcontrol error tests.dtmin,dtmax,failfactor,force_dtmin,advance_to_tstop, andstop_at_next_tstopcontrol time-step selection.tstops,saveat,d_discontinuities, and their corresponding caches manage scheduled times.save_everystep,save_idxs,dense,save_on,save_start,save_end,save_noise,save_discretes, andsave_end_usercontrol output.callback,isoutofdomain, andunstable_checkconfigure step checks.maxiters,verbose, and theprogressfields configure reporting.
Rules
Solver implementations may read or update these fields while stepping, but must preserve the queue invariants maintained by the initialization and time-stop hooks. Application code should configure these options through solve or init, rather than constructing DEOptions directly.
OrdinaryDiffEqCore.DummyController — Type
DummyController()Placeholder controller for algorithms that manage step-size selection themselves (BDF, Nordsieck, Leaping, …). Selecting it makes setup_controller_cache hand back a DummyControllerCache whose dispatch methods fall through to the algorithm-level stepsize_controller! / step_accept_controller! / step_reject_controller! methods that own the actual logic. The per-knob accessors (get_qmin etc.) fall back to fields on integrator.alg for SDE algorithms still using this transitional path.
New code should prefer dedicated controllers like OrdinaryDiffEqBDF.BDFController or OrdinaryDiffEqNordsieck.JVODEController, which expose the knobs as real, settable controller fields.
Rules
Extend the controller dispatch hooks for an algorithm that owns its step-size logic. Do not select DummyController for new algorithms when a dedicated controller can represent their parameters.
Time-stop and saving queues
Custom integrator initialization and stepping loops use these hooks to preserve the standard tstops, saveat, derivative-discontinuity, and time-step-bound semantics. They are versioned developer API, not user-facing solver controls.
OrdinaryDiffEqCore.initialize_tstops — Function
initialize_tstops(::Type{T}, tstops, d_discontinuities, tspan) -> BinaryHeap{T}Build the internal directional time-stop queue for a solver integrator.
Arguments
T::Type: Element type of the queue.tstops: Iterable of requested stopping times.d_discontinuities: Iterable of derivative-discontinuity times.tspan::Tuple: Integration start and end times.
Returns
BinaryHeap{T}: Directional times strictly insidetspan, followed by the final time.
Rules
- Times are stored multiplied by the integration direction, so
pop!visits the next physical time for both forward and reverse integrations. - Entries at or outside the initial and final bounds are discarded; the final bound is inserted exactly once.
- Solver authors implementing a custom
initpath must use this helper sotstopsand derivative discontinuities preserve the standard ordering semantics.
Application code should pass tstops and d_discontinuities to solve or init; it must not construct this queue directly.
Example
tstops_internal = initialize_tstops(Float64, (0.25, 0.75), (), (0.0, 1.0))OrdinaryDiffEqCore.initialize_saveat — Function
initialize_saveat(::Type{T}, saveat, tspan) -> BinaryHeap{T}Build the internal directional queue of output times for a solver integrator.
Arguments
T::Type: Element type of the queue.saveat: A positive output interval or iterable of requested output times.tspan::Tuple: Integration start and end times.
Returns
BinaryHeap{T}: Directional output times accepted by the standardsaveatrules.
Rules
- A scalar
saveatis treated as a positive interval in the integration direction. - An iterable
saveatcontributes only times strictly after the initial bound and at or before the final bound. - Solver authors implementing a custom
initpath must use this helper to preserve forward and reverse integration semantics.
Example
saveat_internal = initialize_saveat(Float64, 0.1, (0.0, 1.0))OrdinaryDiffEqCore.initialize_d_discontinuities — Function
initialize_d_discontinuities(::Type{T}, d_discontinuities, tspan) -> BinaryHeap{T}Build the internal directional queue of derivative-discontinuity times.
Arguments
T::Type: Element type of the queue.d_discontinuities: Iterable of derivative-discontinuity times.tspan::Tuple: Integration start and end times; its direction determines queue order.
Returns
BinaryHeap{T}: Requested discontinuities at or after the initial time in the integration direction, stored directionally.
Rules
- Entries before the initial time in the integration direction are discarded. Entries at the initial time and beyond the final time are retained.
- Solver authors use this queue only when their initialization path supports the
d_discontinuitiessolve keyword.
Example
discontinuities = initialize_d_discontinuities(Float64, (0.5,), (0.0, 1.0))OrdinaryDiffEqCore.fix_dt_at_bounds! — Function
fix_dt_at_bounds!(integrator)Clamp integrator.dt to the active dtmin and dtmax bounds while preserving the integration direction.
Arguments
integrator: An OrdinaryDiffEq integrator withdt,tdir, and time-step bound options.
Returns
nothing
Rules
- Call this from a solver-specific stepping or initialization path after modifying
dtdirectly. - The result lies between the active
dtminanddtmaxbounds in the direction of integration.
Application code should configure dtmin and dtmax through solve or init, rather than mutating an integrator's time step.
Example
integrator.dt = proposed_dt
fix_dt_at_bounds!(integrator)OrdinaryDiffEqCore.handle_tstop! — Function
handle_tstop!(integrator)Process the current time stop after a solver step. This removes reached stops, sets integrator.just_hit_tstop, and handles a fixed-step integrator that crossed a stop by interpolating back to it.
Arguments
integrator: An OrdinaryDiffEq integrator that has just advanced its time state.
Returns
nothing
Rules
- Solver authors that own a stepping loop should call this after advancing time.
- Duplicate stops at the current time are consumed together.
- A fixed-step integrator that crosses a stop is interpolated back to the stop; a time-step-changeable integrator crossing a stop is an invariant violation.
Application code should manage time stops with add_tstop! or the tstops keyword, not call this hook.
Example
perform_step!(integrator, cache, false)
handle_tstop!(integrator)Dense output / interpolation
OrdinaryDiffEqCore.OrdinaryDiffEqInterpolation — Type
OrdinaryDiffEqInterpolation{cacheType} <: SciMLBase.AbstractDiffEqInterpolationAbstract supertype for the dense-output interpolation object attached to a solution. Given a saved timeseries plus derivative (k) history it evaluates the continuous extension. See InterpolationData for the concrete type.
OrdinaryDiffEqCore.InterpolationData — Type
InterpolationData(f, timeseries, ts, ks, alg_choice, dense, cache, differential_vars, sensitivitymode)Concrete OrdinaryDiffEqInterpolation storing everything needed to evaluate the continuous solution: the RHS f, the saved states timeseries at times ts, the stage-derivative history ks, the per-step alg_choice (for composite algorithms), whether dense output is available, the solver cache, the differential_vars mask (for DAEs), and a sensitivitymode flag. Calling (interp)(tvals, idxs, deriv, p, continuity) performs the interpolation.
OrdinaryDiffEqCore.DerivativeOrderNotPossibleError — Type
DerivativeOrderNotPossibleError <: ExceptionThrown when a dense-output interpolation is asked for a derivative order higher than the interpolant supports (Hermite interpolation supports up to order 3).
OrdinaryDiffEqCore.ode_interpolant — Function
ode_interpolant(Θ, dt, y₀, y₁, k, cache, idxs, T::Type{Val{deriv}}, differential_vars)Evaluate the out-of-place dense-output interpolant at fraction Θ ∈ [0, 1] of a step of length dt from y₀ to y₁, using the stage-derivative history k and the algorithm cache. idxs selects components (or nothing for all), deriv is the derivative order, and differential_vars masks algebraic components for DAEs. Solver sublibraries add methods for their cache types; the fallback is Hermite (or linear when k is empty).
OrdinaryDiffEqCore.ode_interpolant! — Function
ode_interpolant!(out, Θ, dt, y₀, y₁, k, cache, idxs, T::Type{Val{deriv}}, differential_vars)In-place version of ode_interpolant: write the interpolated value into out.
OrdinaryDiffEqCore.hermite_interpolant — Function
hermite_interpolant(Θ, dt, y₀, y₁, k, ::Val{mutable}, idxs, T::Type{Val{deriv}}, differential_vars)Evaluate the cubic-Hermite interpolant (or its deriv-th derivative) between y₀ and y₁ from the endpoint derivatives k[1], k[2]. Algebraic components (differential_vars false) fall back to linear interpolation.
Herimte Interpolation, chosen if no other dispatch for ode_interpolant
Herimte Interpolation, chosen if no other dispatch for ode_interpolant
Herimte Interpolation, chosen if no other dispatch for ode_interpolant
OrdinaryDiffEqCore.hermite_interpolant! — Function
hermite_interpolant!(out, Θ, dt, y₀, y₁, k, idxs, T::Type{Val{deriv}}, differential_vars)In-place cubic-Hermite interpolation, writing into out. See hermite_interpolant.
OrdinaryDiffEqCore.interpolation_differential_vars — Function
interpolation_differential_vars(differential_vars, y₀, idxs)Resolve the per-component differential-vs-algebraic mask actually used by the interpolant, given the problem's differential_vars, the value y₀, and the selected idxs. Returns true when all selected components are differential, false when the mask is undefined (forcing linear interpolation), or the appropriate (sub)mask otherwise.
OrdinaryDiffEqCore.current_interpolant — Function
current_interpolant(t, integrator, idxs, deriv)Evaluate the dense-output interpolant of the current step at absolute time(s) t (mapping to Θ = (t - tprev)/dt), for components idxs and derivative order deriv. Out-of-place.
OrdinaryDiffEqCore.current_extrapolant — Function
current_extrapolant(t, integrator, idxs = nothing, deriv = Val{0})Evaluate the extrapolant of the current step at absolute time(s) t, i.e. the continuous extension used to extrapolate beyond an accepted step (maps to Θ = (t - tprev)/(t_cur - tprev)). Out-of-place.
OrdinaryDiffEqCore.current_extrapolant! — Function
current_extrapolant!(val, t, integrator, idxs = nothing, deriv = Val{0})In-place version of current_extrapolant: write the result into val.
OrdinaryDiffEqCore.ode_addsteps! — Function
ode_addsteps!(k, integrator, ...)
ode_addsteps!(k, t, uprev, u, dt, f, p, cache, always_calc_begin = false, allow_calc_end = true, force_calc_end = false)Ensure the stage-derivative array k for the current step is fully populated so the dense-output interpolant can be evaluated. Solver sublibraries add methods that compute their method-specific extra k stages on demand.
OrdinaryDiffEqCore._ode_interpolant — Function
_ode_interpolant(Θ, dt, y₀, y₁, k, cache, idxs, T, differential_vars)Low-level out-of-place interpolation kernel dispatched on the cache type. The generic fallback performs cubic Hermite interpolation (linear when there are fewer than two stage derivatives). Solver sublibraries specialize this for their own dense-output formulas.
OrdinaryDiffEqCore._ode_interpolant! — Function
_ode_interpolant!(out, Θ, dt, y₀, y₁, k, cache, idxs, T, differential_vars)In-place counterpart of _ode_interpolant; writes into out.
OrdinaryDiffEqCore._ode_addsteps! — Function
An Efficient Runge-Kutta (4,5) Pair by P.Bogacki and L.F.Shampine Computers and Mathematics with Applications, Vol. 32, No. 6, 1996, pages 15 to 28
Called to add the extra k9, k10, k11 steps for the Order 5 interpolation when needed
An Efficient Runge-Kutta (4,5) Pair by P.Bogacki and L.F.Shampine Computers and Mathematics with Applications, Vol. 32, No. 6, 1996, pages 15 to 28
Called to add the extra k9, k10, k11 steps for the Order 5 interpolation when needed
_ode_addsteps!(k, t, uprev, u, dt, f, p, cache, always_calc_begin = false, allow_calc_end = true, force_calc_end = false)Generic fallback for ode_addsteps! that fills k[1], k[2] with the RHS at the step endpoints (f(uprev, p, t) and f(u, p, t+dt)), sufficient for cubic-Hermite dense output.
Noise-process hooks
Used by SDE/RODE solver sublibraries; no-ops for pure ODEs.
OrdinaryDiffEqCore.accept_noise! — Function
accept_noise!(W, dt, u, p, setup)Advance/accept the noise process W over the accepted step of size dt (the Brownian bridge/random values for [t, t+dt] are committed). No-op when W is nothing (pure ODE). Extended by StochasticDiffEq for NoiseProcess types.
OrdinaryDiffEqCore.reject_noise! — Function
reject_noise!(W, dt, u, p)Roll back the noise process W after a rejected step of size dt so it can be re-sampled consistently on the retry. No-op when W is nothing.
OrdinaryDiffEqCore.save_noise! — Function
save_noise!(W)Persist the current value of the noise process W into its saved history. No-op when W is nothing.
OrdinaryDiffEqCore.reinit_noise! — Function
reinit_noise!(W, dt)Reset the noise process W to its initial state for a fresh integration with step dt (used by reinit!). No-op when W is nothing.
OrdinaryDiffEqCore.noise_curt — Function
noise_curt(W)Return the current time of the noise process W, or nothing when W is nothing. Used to check whether the noise has already advanced to the current integrator time.
OrdinaryDiffEqCore.is_noise_saveable — Function
is_noise_saveable(W) -> BoolReturn whether the noise process W supports saving its trajectory (false when W is nothing).
Docstring builders
Helpers that build consistent algorithm docstrings.
OrdinaryDiffEqCore.generic_solver_docstring — Function
Utility function to help generating consistent docstrings across the package.
OrdinaryDiffEqCore.explicit_rk_docstring — Function
explicit_rk_docstring(description, name; references = "", extra_keyword_description = "", extra_keyword_default = "") -> StringConvenience wrapper over generic_solver_docstring for explicit Runge–Kutta methods. Prepends the standard stage_limiter! / step_limiter! / thread keywords (and any extra_keyword_*) and fills in the "Explicit Runge-Kutta Method" solver class.
OrdinaryDiffEqCore.differentiation_rk_docstring — Function
differentiation_rk_docstring(description, name, solver_class; references = "", extra_keyword_description = "", extra_keyword_default = "") -> StringConvenience wrapper over generic_solver_docstring for implicit / Rosenbrock methods that take differentiation options. Prepends the standard autodiff, concrete_jac, and linsolve keywords (and any extra_keyword_*) with their descriptions.
Stochastic solver extension API
These names are a version-controlled contract for sibling stochastic solver packages. They are not application-facing solver API; use the stochastic algorithm pages to select methods for solve.
StochasticDiffEqCore.AbstractJ — Type
AbstractJSupertype for the objects that evaluate the iterated stochastic integrals J needed by higher order SDE solvers.
All stochastic iterated integrals are written in the Stratonovich sense, as indicated by the J. An AbstractJ is produced from a problem and an algorithm by get_Jalg and is then evaluated with get_iterated_I (out-of-place) or get_iterated_I! (in-place, storing the result in the object's J field).
Subtypes: AbstractJDiagonal, AbstractJCommute, and the Lévy area algorithms of StochasticDiffEqLevyArea together with IteratedIntegralAlgorithm_iip.
StochasticDiffEqCore.AbstractJCommute — Type
AbstractJCommute <: AbstractJIterated-integral evaluators for commutative noise, where the Lévy area terms cancel and the integrals reduce to the outer product 1/2 ΔW ΔWᵀ.
Subtypes: JCommute_oop, JCommute_iip.
StochasticDiffEqCore.AbstractJDiagonal — Type
AbstractJDiagonal <: AbstractJIterated-integral evaluators for diagonal (or scalar) noise, where the integrals reduce to 1/2 ΔWᵢ² componentwise and no Lévy area approximation is required.
Subtypes: JDiagonal_oop, JDiagonal_iip.
StochasticDiffEqCore.DiffEqNLSolveTag — Type
DiffEqNLSolveTagForwardDiff tag type used for the Jacobians of the nonlinear solves inside the SDE integrators.
Tagging the duals keeps derivatives taken by the integrator distinguishable from derivatives a user takes through solve, which is what allows nested differentiation to work (see the ForwardDiff.jl documentation on tags).
StochasticDiffEqCore.IICommutative — Type
IICommutative()Iterated-integral strategy that assumes the noise is commutative.
Under commutative noise the Lévy area terms cancel and the iterated integrals reduce to 1/2 ΔW ΔWᵀ, which is cheap and exact for that problem class. Selecting this for a genuinely non-commutative problem silently loses the method's strong order, so use IILevyArea unless commutativity is known to hold.
StochasticDiffEqCore.IIFNLSolveFunc — Type
IIFNLSolveFunc(f)Wrapper holding the residual function f of an IIF nonlinear solve.
NLSOLVEJL_SETUP returns one of these from its Val{:init} call so that the in-place residual f(resid, u) can later be turned into a NonlinearProblem without recapturing the surrounding cache.
StochasticDiffEqCore.IILevyArea — Type
IILevyArea()Iterated-integral strategy that approximates the Lévy area numerically.
This is the general-purpose choice: the number of terms is selected automatically from the step size and the requested accuracy, and an appropriate simulation algorithm is picked by StochasticDiffEqLevyArea.optimal_algorithm. It is more expensive than IICommutative but does not assume anything about the noise structure.
StochasticDiffEqCore.Ihat2 — Function
Ihat2(...)Approximation of the second-order multiple stochastic integral used by the weak order 2 schemes.
Only the generic function lives here; the methods are defined in StochasticDiffEqWeak alongside the cache types they dispatch on, because their argument lists differ between the DRI/RI (Rößler) and RDI families.
StochasticDiffEqCore.IteratedIntegralAlgorithm_iip — Type
IteratedIntegralAlgorithm_iip(ΔW, levyalg)In-place wrapper around a StochasticDiffEqLevyArea iterated-integral algorithm.
StochasticDiffEqLevyArea's algorithms are allocating; this wrapper pairs one of them (levyalg) with a preallocated length(ΔW) × length(ΔW) buffer J, so that get_iterated_I! can serve in-place solvers with general non-commutative noise.
StochasticDiffEqCore.IteratedIntegralApprox — Type
IteratedIntegralApproxSupertype for the strategies used to approximate the iterated stochastic integrals (Lévy areas) that higher order SDE solvers need for non-diagonal noise.
An algorithm carries its choice in the ii_approx field, and get_Jalg turns that choice plus the problem's noise structure into the concrete AbstractJ object that computes the integrals.
Subtypes: IICommutative, IILevyArea.
StochasticDiffEqCore.JCommute_iip — Type
JCommute_iip(ΔW)In-place iterated-integral evaluator for commutative noise, preallocated to a length(ΔW) × length(ΔW) matrix.
get_iterated_I! writes 1/2 * vec(ΔW) * vec(ΔW)' into the J field.
StochasticDiffEqCore.JCommute_oop — Type
JCommute_oop()Out-of-place iterated-integral evaluator for commutative noise.
get_iterated_I returns a freshly allocated 1/2 .* vec(ΔW) .* vec(ΔW)'.
StochasticDiffEqCore.JDiagonal_iip — Type
JDiagonal_iip(ΔW)In-place iterated-integral evaluator for diagonal noise, preallocated to the shape of the Brownian increment ΔW.
get_iterated_I! writes 1/2 * ΔW^2 into the J field.
StochasticDiffEqCore.JDiagonal_oop — Type
JDiagonal_oop()Out-of-place iterated-integral evaluator for diagonal noise.
get_iterated_I returns a freshly allocated 1/2 .* ΔW .* ΔW.
StochasticDiffEqCore.NLSOLVEJL_SETUP — Type
NLSOLVEJL_SETUP(; autodiff = AutoForwardDiff())Nonlinear-solver setup used by the IIF (implicit integrating factor) methods.
The name is historical — the solve is no longer performed by NLsolve.jl but by SimpleTrustRegion from SimpleNonlinearSolve.jl. A setup object is callable in two ways: setup(Val{:init}, f, u0_prototype) wraps f in an IIFNLSolveFunc, and setup(wrapped_f, u0) solves f(resid, u) = 0 starting from u0 and returns the root.
Keyword Arguments
autodiff: ADTypes.jl backend used for the Jacobian of the inner solve (default:AutoForwardDiff()).
StochasticDiffEqCore.SDEAlgTypes — Type
SDEAlgTypesUnion of the algorithm supertypes that the SDE integrator loop handles, i.e. StochasticDiffEqAlgorithm and StochasticDiffEqRODEAlgorithm.
Used to constrain SDEIntegrator and to write methods that apply to both SDE and RODE algorithms at once.
StochasticDiffEqCore.SDEIntegrator — Type
SDEIntegratorThe integrator type for SDE and RODE problems: an ODEIntegrator specialized to an algorithm in SDEAlgTypes.
SDE integration reuses OrdinaryDiffEqCore's integrator machinery and adds the noise process in the W field (and P for jump problems), so this alias is what SDE-specific methods — resizing, noise cache handling, the interpolation and step interface — dispatch on.
StochasticDiffEqCore.SDEOptions — Type
SDEOptionsAlias for OrdinaryDiffEqCore.DEOptions, the container holding the solver options (tolerances, callbacks, save settings) of a running integrator.
Kept as its own name for downstream packages such as StochasticDelayDiffEq that were written against the pre-migration StochasticDiffEq.SDEOptions.
StochasticDiffEqCore.DiffCache — Type
DiffCache(u)
DiffCache(u, nlsolve)
DiffCache(u, ::Type{Val{chunk_size}})
DiffCache(T, size, ::Type{Val{chunk_size}})Dual-buffered cache holding both a plain array and a ForwardDiff.Dual array of the same shape.
An in-place function that must work both on ordinary numbers and on duals cannot use a single preallocated buffer, because the element types differ. DiffCache stores one buffer of each and SciMLBase.get_du picks the right one from the element type at the call site.
The chunk size defaults to ForwardDiff.pickchunksize(length(u)), or is taken from the nonlinear solver via get_chunksize when one is supplied.
StochasticDiffEqCore.@cache — Macro
@cache struct MyAlgCache{...} <: StochasticDiffEqMutableCache
...
endDefine an SDE solver cache and generate its buffer accessors.
resize! on an integrator has to grow or shrink every buffer a cache holds, and the noise machinery has to know which of them are noise-shaped rather than state-shaped. Rather than writing those accessors by hand for each cache, @cache emits them from the declared field types:
full_cache— fields typeduType,rateType,kType, oruNoUnitsType, plus thedu/dual_dupair of aDiffCacheTypefield and the duals ofJCTypeandGCTypefields.rand_cache— fields typedrandType.ratenoise_cache— fields typedrateNoiseTypeorrateNoiseCollectionType.jac_iter— fields typedJTypeorWType.
Fields whose type parameter is none of the above are left out of all four accessors, which is the correct behavior for scalars, tableaus, and nonlinear solver objects.
StochasticDiffEqCore.StochasticCompositeAlgorithm — Type
StochasticCompositeAlgorithm(algs, choice_function)Algorithm that switches between the members of algs from step to step.
choice_function(integrator) returns the index into algs of the member to use for the next step; the matching cache is held in a StochasticCompositeCache and selected through its current field.
This is the mechanism behind the automatic stiffness-switching solvers — see AutoAlgSwitch, which pairs a nonstiff and a stiff algorithm with an AutoSwitch choice function.
StochasticDiffEqCore.StochasticCompositeCache — Type
StochasticCompositeCache(caches, choice_function, current)Cache of a StochasticCompositeAlgorithm.
Holds one member cache per member algorithm in caches, the choice_function that selects among them, and current, the index chosen for the step being taken. unwrap_alg and get_current_alg_order read current so that perform_step! and the adaptivity see the member that is actually running.
StochasticDiffEqCore.TauLeapingDrift — Type
TauLeapingDrift{C, R, RateCache, IIP}(c, rate, rate_cache)Callable that presents the drift of a tau-leaping jump problem as an ordinary ODE right-hand side.
The drift is ν ⋅ a(u) written in terms of the RegularJump pieces: rate is the propensity function a and c is the stoichiometry function that applies the jump counts. The wrapper evaluates c(u, p, t, rate(u, p, t), nothing), which is exactly the function the implicit tau-leaping methods hand to their nonlinear solver.
The IIP type parameter selects the calling convention: out-of-place instances are called as drift(u, p, t), in-place ones as drift(du, u, p, t) and use rate_cache as scratch space for the propensities.
StochasticDiffEqCore._resolve_rng — Function
_resolve_rng(rng, seed, prob) -> (rng, seed, rng_provided)Resolve the RNG and seed for an SDE/RODE integration from the user-provided rng and seed kwargs plus the problem's stored seed.
StochasticDiffEqCore._sde_init — Function
_sde_init(prob, alg; kwargs...) -> SDEIntegratorBuild the SDEIntegrator for prob and alg.
This is the body of SciMLBase.__init for SDE, RODE, and jump problems: it resolves the options and the RNG, allocates the solution object, the algorithm cache (alg_cache) and the noise process, and returns the integrator positioned at the initial condition. solve is init followed by solve!, so every documented solve keyword is accepted here.
It is exposed separately from __init so that downstream packages which build on the SDE integrator (for example StochasticDelayDiffEq) can construct one without going through SciMLBase.__init dispatch.
StochasticDiffEqCore._z_prototype — Function
_z_prototype(alg, rand_prototype, iip::Bool) -> rand_prototype2Compute the Z process prototype for algorithms that need an extra Brownian process. Default: use rand_prototype itself as Z prototype (same shape as W). Solver subpackages override this for algorithms with special Z requirements (e.g., PL1WM, RKMilGeneral, W2Ito1).
_z_prototype(alg, rand_prototype, iip::Bool, dt) -> rand_prototype2Step-size aware form of _z_prototype, used when the size of the Z process depends on the step size — as it does for Lévy area truncations, where the number of retained series terms is chosen from the accuracy the step size demands.
dt is the initial step size as passed to solve, which is zero when the caller left it to be determined automatically. Since the Z prototype must be built before the initial step size is known, an algorithm that sizes from dt needs a fallback for that case.
Defaults to the three-argument form, so an override only has to be added by algorithms that actually need the step size.
StochasticDiffEqCore.addat_noise! — Function
addat_noise!(integrator, cache, idxs) -> nothingInsert new components at positions idxs in the noise process of integrator.
The counterpart of deleteat_noise!, called from addat! on the integrator. Space is made in every noise buffer and in the cached increments of the interpolation stacks, and the new slots are filled with freshly sampled increments through fill_new_noise_caches!.
StochasticDiffEqCore.alg_cache — Function
alg_cache(
alg, prob, u, ΔW, ΔZ, p, rate_prototype, noise_rate_prototype,
jump_rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits},
::Type{tTypeNoUnits}, uprev, f, t, dt, ::Type{Val{iip}}, verbose
)Construct the per-algorithm cache used by perform_step!.
This is the main extension point for SDE solver subpackages: each algorithm defines a cache type (usually with the @cache macro, which also generates the full_cache, rand_cache, and ratenoise_cache accessors used for resize!) and one alg_cache method that allocates it. The Val{iip} argument selects the in-place or out-of-place variant, and the *NoUnits type arguments give the element types the error estimates should be computed in.
The fallback method defined here errors, pointing at the solver subpackage that needs to be loaded for alg.
StochasticDiffEqCore.alg_compatible — Function
alg_compatible(prob, alg) -> BoolWhether alg can solve prob.
solve consults this trait before setting up an integrator and errors with a descriptive message when it returns false. Solver subpackages add methods for the problem classes their algorithm supports, for example a Milstein-type method that requires diagonal noise:
alg_compatible(prob::SciMLBase.AbstractSDEProblem, alg::RKMil) = is_diagonal_noise(prob)For a StochasticCompositeAlgorithm the result is the maximum over its members, and for a JumpProblem compatibility additionally requires that the algorithm supports_regular_jumps whenever the problem carries a RegularJump.
StochasticDiffEqCore.alg_control_rate — Function
alg_control_rate(alg) -> BoolWhether the adaptive step-size controller of alg acts on the jump/leap rate rather than on the usual solution error estimate.
Tau-leaping methods choose dt from how much the propensities are allowed to change over a step, so they override this to true and the integrator routes step-size control through the leap-specific controller instead of the standard EEst path.
StochasticDiffEqCore.alg_mass_matrix_compatible — Function
alg_mass_matrix_compatible(alg) -> BoolWhether alg can solve a problem with a non-identity mass matrix.
solve errors when a mass matrix is supplied to an algorithm for which this is false. The implicit theta-method solvers accept a mass matrix only in the configurations for which the discretization stays consistent (symplectic, or theta == 1) and throw a descriptive error otherwise.
StochasticDiffEqCore.alg_stability_size — Function
alg_stability_size(alg) -> RealRadius of the (deterministic) stability region of alg along the negative real axis.
This is the scale used by the automatic stiffness detection of AutoSwitch: the stiffness ratio is abs(eigen_est * dt / alg_stability_size(alg)), so an algorithm participating in a stiffness-switching composite must report a nonzero value. The default of 0 means "not characterized", and is overridden per algorithm in the solver subpackages.
StochasticDiffEqCore.alg_can_repeat_jac — Function
alg_can_repeat_jac(alg) -> BoolWhether alg may reuse a Jacobian across a rejected-and-repeated step.
When true the integrator keeps the factorized W matrix after a step rejection instead of recomputing it, which is the common case. Algorithms whose stage structure changes between attempts must override this to false.
StochasticDiffEqCore.alg_needs_extra_process — Function
alg_needs_extra_process(alg) -> BoolWhether alg needs a second noise process ΔZ alongside the Brownian increment ΔW.
Higher order schemes (for example the Rößler SRA/SRI families) require an auxiliary independent process to approximate the extra stochastic integrals appearing in their order conditions. When this trait is true the integrator allocates and resizes the Z process in addition to W, so solver subpackages must set it for any algorithm that reads integrator.W.dZ.
For a StochasticCompositeAlgorithm the result is the maximum over its members, so the extra process is present if any member needs it.
StochasticDiffEqCore.calc_threepoint_random — Function
calc_threepoint_random(sq3dt, quantile, dW_scaled)Three-point discrete random variable replacing the Brownian increment in a weak (moment-matching) scheme.
Returns -sq3dt, 0, or +sq3dt depending on where the standardized increment dW_scaled falls relative to quantile. Unlike the two-point variable of calc_twopoint_random this matches the fourth moment of the Gaussian as well, which weak order 2 schemes require.
sq3dt is sqrt(3dt), and quantile is the (negative) standard-normal quantile that gives the zero outcome its correct probability.
StochasticDiffEqCore.calc_threepoint_random! — Function
calc_threepoint_random!(_dW, sq3dt, quantile, dW_scaled) -> nothingIn-place form of calc_threepoint_random, writing the discrete increments into _dW.
StochasticDiffEqCore.calc_twopoint_random — Function
calc_twopoint_random(sqdt, dW)Two-point discrete random variable replacing the Brownian increment in a weak (moment-matching) scheme.
Returns ±sqdt, taking the sign of dW, so the result has the same mean and variance as the Brownian increment while taking only two values. Weak-order methods may substitute such a variable because they only need the moments of the noise to match, and sampling two points is cheaper than sampling a Gaussian.
sqdt is sqrt(dt). See calc_threepoint_random for the variant that also matches the fourth moment.
StochasticDiffEqCore.calc_twopoint_random! — Function
calc_twopoint_random!(_dW, sqdt, dW) -> nothingIn-place form of calc_twopoint_random, writing the discrete increments into _dW.
StochasticDiffEqCore.concrete_prob — Function
concrete_prob(prob) -> probThe underlying differential equation problem carried by prob.
For an SDEProblem, RODEProblem, or DiscreteProblem this is prob itself; for a JumpProblem it is the wrapped prob.prob. Setup code that needs to inspect the problem's f, u0, or tspan goes through this so it works uniformly with and without a jump wrapper.
StochasticDiffEqCore.deleteat_noise! — Function
deleteat_noise!(integrator, cache, idxs) -> nothingDelete the components idxs from the noise process of integrator.
The counterpart of addat_noise!, called from deleteat! on the integrator: the same components are removed from every noise buffer and from the cached increments in the interpolation stacks, keeping the process dimension in step with the shrunken state.
StochasticDiffEqCore.delta_default — Function
delta_default(alg) -> RealDefault value of the delta option for alg.
delta is the SDE-specific mixing parameter of the adaptive error estimate: it weighs the drift (deterministic) error contribution against the diffusion (stochastic) one when the two are combined into a single EEst. A value of 1 uses the drift estimate at full strength.
Solver subpackages override this for algorithms whose published adaptivity scheme prescribes a different weighting.
StochasticDiffEqCore.determine_chunksize — Function
determine_chunksize(u, alg) -> Int
determine_chunksize(u, CS) -> IntForwardDiff chunk size to use when differentiating with respect to a state like u.
A nonzero explicitly configured chunk size CS (or the one reported by get_chunksize for alg) is used as-is; 0 means "not configured" and falls back to ForwardDiff.pickchunksize(length(u)).
StochasticDiffEqCore.fill_new_noise_caches! — Function
fill_new_noise_caches!(integrator, c, scaling_factor, idxs) -> nothingSample fresh noise increments into positions idxs of a cached noise entry c.
c is one entry of the noise process's interpolation stacks (W.S₁/W.S₂), a tuple whose first element is the step's scaling factor and whose remaining elements hold the cached ΔW and, when alg_needs_extra_process holds, ΔZ values. The new values are drawn from the process's own distribution so that the extended path has the correct law.
Used by resize_noise! and addat_noise! whenever the state grows.
StochasticDiffEqCore.get_chunksize — Function
get_chunksize(x) -> IntForwardDiff chunk size configured on x, or 0 when x does not configure one.
0 is the "unset" sentinel that makes determine_chunksize fall back to ForwardDiff.pickchunksize.
StochasticDiffEqCore.get_current_alg_order — Function
get_current_alg_order(alg, cache) -> RealStrong order of the algorithm that is currently being stepped with.
For a plain algorithm this is just alg_order(alg). For a StochasticCompositeAlgorithm it is the order of the member algorithm selected by cache.current, so that adaptivity uses the order of the method that actually took the step rather than the order of the composite as a whole.
StochasticDiffEqCore.get_Jalg — Function
get_Jalg(ΔW, dt, prob, alg) -> AbstractJSelect the iterated-integral evaluator to use for prob with alg.
The choice combines the algorithm's ii_approx field — an IteratedIntegralApprox — with the problem's noise structure and whether it is in-place:
IILevyAreauses a diagonal evaluator when the noise is diagonal or scalar, and otherwise the StochasticDiffEqLevyArea algorithm chosen byoptimal_algorithm(length(ΔW), dt)(wrapped inIteratedIntegralAlgorithm_iipfor in-place problems).IICommutativeuses a diagonal evaluator for diagonal/scalar noise and a commutative evaluator otherwise.- Any other
ii_approxis taken to be a concrete Lévy area algorithm and is used directly.
A solver subpackage can override the choice for a specific algorithm by adding a method, e.g. get_Jalg(ΔW, dt, prob, alg::MySolver) = MronRoe().
StochasticDiffEqCore.get_iterated_I — Function
get_iterated_I(dt, dW, dZ, alg, p = nothing, c = 1, γ = 1 // 1)Evaluate and return the Stratonovich iterated stochastic integrals for the step, out of place.
Arguments
dt: The step size.dW,dZ: The Brownian increment and, where the method needs one, the auxiliary increment for the step.alg: TheAbstractJevaluator, as produced byget_Jalg.p: Number of terms in the Lévy area series.nothing(the default) selects it automatically from the requested accuracyε = c * dt^(γ + 1/2).c,γ: Constant and exponent of that accuracy target, normally the constant and strong order of the calling solver.
See get_iterated_I! for the in-place form.
StochasticDiffEqCore.get_iterated_I! — Function
get_iterated_I!(dt, dW, dZ, alg, p = nothing, c = 1, γ = 1 // 1)In-place form of get_iterated_I: compute the Stratonovich iterated stochastic integrals for the step and store them in alg.J, returning nothing.
StochasticDiffEqCore.is_split_step — Function
is_split_step(alg) -> BoolWhether alg is a split-step method, i.e. one that advances the drift to an intermediate state before applying the diffusion rather than adding both contributions to the same base point.
The split-step solvers (ISSEM, ISSEulerHeun) override this to true; the integrator uses it to select the matching residual and error-estimate paths.
StochasticDiffEqCore.resize_noise! — Function
resize_noise!(integrator, cache, bot_idx, i) -> nothingResize the noise process of integrator to length i after the state was resized.
All of the noise process's buffers (dW, dWtilde, dWtmp, curW, the dZ family when alg_needs_extra_process holds, and the cached increments in the interpolation stacks S₁/S₂) are grown or shrunk together. New entries from bot_idx up to i are filled with freshly sampled increments via fill_new_noise_caches! so the process stays consistent with the already generated path.
This is called from the resize! integrator interface; see deleteat_noise! and addat_noise! for the index-wise variants.
StochasticDiffEqCore.supports_regular_jumps — Function
supports_regular_jumps(alg) -> BoolWhether alg can integrate a JumpProblem that carries a RegularJump.
Regular jumps are leaped over with a Poisson count per step rather than simulated one event at a time, which only some SDE integrators implement. The default is false; EM and ImplicitEM override it to true in their subpackages. alg_compatible uses this trait to reject a RegularJump problem paired with an algorithm that cannot handle it.
StochasticDiffEqCore.AutoAlgSwitch — Function
AutoAlgSwitch(nonstiffalg, stiffalg; kwargs...) -> StochasticCompositeAlgorithmBuild a stiffness-switching composite of nonstiffalg and stiffalg.
This is the constructor behind the Auto* SDE solvers (for example AutoSOSRI2): it wraps the two algorithms in a StochasticCompositeAlgorithm whose choice function is an AutoSwitch. All keyword arguments are forwarded to AutoSwitch.
alg = AutoAlgSwitch(SOSRI(), ImplicitEM(); maxstiffstep = 5)StochasticDiffEqCore.AutoSwitch — Type
AutoSwitch(
nonstiffalg, stiffalg; maxstiffstep = 10, maxnonstiffstep = 3,
nonstifftol = 9 // 10, stifftol = 9 // 10, dtfac = 2,
stiffalgfirst = false, switch_max = 5
)Choice function that switches a StochasticCompositeAlgorithm between a nonstiff and a stiff method based on an online stiffness estimate.
Each step the estimate abs(eigen_est * dt / alg_stability_size(alg)) is compared against a tolerance. Consecutive verdicts are counted, and the algorithm is only switched once the count exceeds the corresponding threshold, which prevents thrashing on a borderline problem.
Keyword Arguments
maxstiffstep: Number of consecutive stiff verdicts required before switching tostiffalg(default:10).maxnonstiffstep: Number of consecutive nonstiff verdicts required before switching back tononstiffalg(default:3).nonstifftol,stifftol: Stiffness-ratio tolerances used while the nonstiff and the stiff algorithm is active, respectively (default:9//10for both).dtfac: Factor applied todtat a switch —dtis multiplied by it when moving to the stiff method and divided by it when moving back (default:2).stiffalgfirst: Start withstiffalginstead ofnonstiffalg(default:false).switch_max: Number of successive nonstiff verdicts after which the error check is re-enabled (default:5).
Use AutoAlgSwitch to build the composite algorithm directly.
StochasticDiffEqCore.unwrap_alg — Function
unwrap_alg(integrator, is_nlsolve) -> algThe concrete algorithm that integrator should use for the current step.
For a plain algorithm this is integrator.alg itself. For a StochasticCompositeAlgorithm it is the currently selected member: the stiff member when is_nlsolve is true under AutoSwitch-style stiffness switching, and the member indicated by integrator.cache.current otherwise.
perform_step! implementations call this instead of reading integrator.alg directly so that they work unchanged inside a composite algorithm.
High-order stochastic tableau construction
StochasticDiffEqHighOrder.checkSRAOrder — Function
checkSRAOrder(RosslerSRI)Determines whether the order conditions are met via the tableaus of the SRA method.
StochasticDiffEqHighOrder.checkSRIOrder — Function
checkSRIOrder(RosslerSRI)Determines whether the order conditions are met via the tableaus of the SRI method.
StochasticDiffEqHighOrder.constructExplicitSKenCarp — Function
constructExplicitSKenCarp()Constructs the tableau type for the explicit part of SKenCarp as a RosslerSRA tableau.
StochasticDiffEqHighOrder.constructSKenCarp — Function
constructSKenCarp()Constructs the tableau type for the implicit SKenCarp method as a RosslerSRA tableau.
StochasticDiffEqHighOrder.constructSOSRA — Function
constructSOSRA()Constructs the taleau type for the SOSRA method.
StochasticDiffEqHighOrder.constructSOSRA2 — Function
constructSOSRA2()Constructs the taleau type for the SOSRA method.
StochasticDiffEqHighOrder.constructSRA1 — Function
constructSRA1()Constructs the taleau type for the SRA1 method.
StochasticDiffEqHighOrder.constructSRA2 — Function
constructSRA2()Constructs the taleau type for the SRA2 method.
StochasticDiffEqHighOrder.constructSRA3 — Function
constructSRA3()Constructs the taleau type for the SRA3 method.
StochasticDiffEqHighOrder.constructSRIOpt1 — Function
constructSRIOpt1()Opti6-12-11-10-01-47
StochasticDiffEqHighOrder.constructSRIOpt2 — Function
constructSRIOpt2()Opti6-12-11-10-01-47
StochasticDiffEqHighOrder.constructSRIW1 — Function
constructSRIW1()Constructs the tableau type for the SRIW1 method.
StochasticDiffEqHighOrder.constructSRIW2 — Function
constructSRIW2()Constructs the tableau type for the SRIW1 method.
StochasticDiffEqHighOrder.du_cache — Function
du_cache(cache::SRACache)Return derivative and noise-work buffers stored by an SRACache. This is a developer extension hook for the SRA cache implementation.
Returns
A tuple of internal work buffers. Its order and contents are a solver-internal contract and must not be used by application code.
StochasticDiffEqHighOrder.u_cache — Function
u_cache(cache::SRACache)Return additional mutable state buffers for an SRACache. Solver implementations use this developer hook when resizing or inspecting a high-order SRA cache.
Returns
An empty tuple for SRACache; user code must not rely on cache-hook tuple layouts.
StochasticDiffEqHighOrder.user_cache — Function
user_cache(cache::SRACache)Return the user-state buffers stored by an SRACache. This developer hook is used by solver infrastructure; application code should not depend on its tuple layout.
Returns
A tuple containing the current and previous user states plus internal temporaries. Its order and contents are only a solver-extension contract.
ESDIRK-IMEX implementation hooks
The following types are developer API for sibling implicit solver packages. They are not stable application-facing cache layouts.
OrdinaryDiffEqSDIRK.ESDIRKIMEXCache — Type
ESDIRKIMEXCache <: SDIRKMutableCacheIn-place solver cache for the ESDIRK-IMEX methods. Holds the stage values zs, stage-derivative buffers ks, error temporary atmp, nonlinear solver nlsolver, tableau tab, step limiter, and the extra history slots (uprev2/uprev3/tprev2) and algebraic_vars mask.
OrdinaryDiffEqSDIRK.ESDIRKIMEXConstantCache — Type
ESDIRKIMEXConstantCache <: OrdinaryDiffEqConstantCacheOut-of-place solver cache for the ESDIRK-IMEX methods. Holds the nonlinear solver nlsolver, the Butcher tableau tab, and the extra history slots uprev3 / tprev2 used by the embedded error estimate. Declared public so downstream IMEX solvers can reuse the ESDIRK-IMEX step.
OrdinaryDiffEqSDIRK.ImplicitEulerESDIRKIMEXTableau — Function
ImplicitEulerESDIRKIMEXTableau(T, T2)Construct the single-stage ESDIRK-IMEX Butcher tableau whose implicit part is the implicit Euler method (element types T for coefficients, T2 for abscissae). Used as the base tableau for the implicit-Euler IMEX splitting scheme.
Cross-sublibrary cache hooks
These opaque cache types are developer-only extension contracts for sibling solver packages. Application code must construct algorithms and call solve, rather than depend on cache fields or constructors.
OrdinaryDiffEqLowOrderRK.BS3Cache — Type
BS3Cache <: OrdinaryDiffEqMutableCacheIn-place solver cache for the Bogacki–Shampine 3(2) method (BS3), holding its stage buffers, embedded-error temporaries, tableau (BS3ConstantCache), and the stage/step limiters and threading option. Declared public because other sublibraries (e.g. the Adams–Bashforth–Moulton starters) reuse the BS3 step.
OrdinaryDiffEqLowOrderRK.BS3ConstantCache — Type
BS3ConstantCache{T, T2} <: OrdinaryDiffEqConstantCacheDeveloper-only tableau cache for the Bogacki-Shampine 3(2) method (BS3). Sibling solver packages obtain it through alg_cache; application code should use BS3() rather than depend on this cache representation.
OrdinaryDiffEqLowOrderRK.RK4Cache — Type
RK4Cache <: OrdinaryDiffEqMutableCacheIn-place solver cache for the classical 4th-order Runge–Kutta method (RK4), holding its four stage buffers, error/temporary buffers, and the stage/step limiters and threading option.
OrdinaryDiffEqLowOrderRK.RK4ConstantCache — Type
RK4ConstantCache <: OrdinaryDiffEqConstantCacheOut-of-place solver cache for the classical 4th-order Runge–Kutta method (RK4). Carries no state (the coefficients are compile-time constants).
OrdinaryDiffEqRosenbrock.RosenbrockMutableCache — Type
RosenbrockMutableCache <: OrdinaryDiffEqMutableCacheAbstract supertype for the in-place caches of the Rosenbrock (and Rosenbrock-W) methods. Concrete Rosenbrock caches subtype this; the shared integrator interface dispatches on it to access the stage buffers, Jacobian/W matrices, and differentiation configs common to the Rosenbrock family. Declared public so cross-sublibrary references to the Rosenbrock cache hierarchy are recognized as a supported extension point.
OrdinaryDiffEqTsit5.Tsit5Cache — Type
Tsit5Cache <: OrdinaryDiffEqMutableCacheIn-place solver cache for the Tsitouras 5(4) method (Tsit5), holding its stage buffers k1…k7, temporaries, embedded-error buffer, and the stage/step limiters and threading option. Declared public so other sublibraries can reuse the Tsit5 step.
OrdinaryDiffEqTsit5.Tsit5ConstantCache — Type
Tsit5ConstantCache <: OrdinaryDiffEqConstantCacheOut-of-place solver cache for the Tsitouras 5(4) method (Tsit5). Carries no mutable state (the tableau coefficients are generated on demand).