SteadyStateDiffEq.jl

SteadyStateDiffEq.jl is the native Julia package for solving steady state problems within the SciML ecosystem. It provides methods for finding equilibrium solutions of differential equations.

Installation

SteadyStateDiffEq.jl is included with DifferentialEquations.jl. To use it standalone:

using Pkg
Pkg.add("SteadyStateDiffEq")
import SteadyStateDiffEq

Steady State Solver APIs

SteadyStateDiffEq.DynamicSSType
DynamicSS(alg = nothing; tspan = Inf) -> DynamicSS

Solve a steady-state problem by evolving the corresponding ODE until the derivative is close to zero.

DynamicSS internally adds a TerminateSteadyState callback. The abstol and reltol keywords passed to solve control the steady-state termination condition. Use odesolve_kwargs to pass separate keyword arguments to the ODE solve.

Arguments

  • alg: the ODE solver algorithm passed to solve. When alg === nothing, the default ODE solver is selected by the downstream solver package.

Keywords

  • tspan: the time span used for the ODE solve. If tspan is a number, it is equivalent to (zero(tspan), tspan).

Fields

  • alg: ODE solver algorithm, or nothing to request downstream default selection.
  • tspan: time span passed to the internal ODE solve.

Example

julia> using SciMLBase: SteadyStateProblem, solve

julia> using SteadyStateDiffEq

julia> using Sundials: CVODE_BDF

julia> prob = SteadyStateProblem((u, p, t) -> 1 .- u, [0.0]);

julia> sol = solve(prob, DynamicSS(CVODE_BDF()); dt = 1.0);
Note

The default alg of nothing works only if DifferentialEquations.jl is installed and loaded.

Note

If you use CVODE_BDF you may need to give a starting dt via dt = .....

SteadyStateDiffEq.SSRootfindType
SSRootfind(alg = nothing) -> SSRootfind

Solve a steady-state problem by converting it to a NonlinearProblem and calling a nonlinear solver.

Arguments

  • alg: the nonlinear solver algorithm passed to solve. When alg === nothing, the default nonlinear solver is selected by the downstream solver package.

Fields

  • alg: nonlinear solver algorithm, or nothing to request downstream default selection.

Example

julia> using SciMLBase: SteadyStateProblem, solve

julia> using SteadyStateDiffEq

julia> using NonlinearSolve

julia> prob = SteadyStateProblem((u, p, t) -> 1 .- u, [0.0]);

julia> sol = solve(prob, SSRootfind());
Note

The default alg of nothing works only if NonlinearSolve.jl is installed and loaded.