Version: dev

ode_components

Stable function · Evaluate the Jacobian

Tier: stable · Kind: function · Topic: Evaluate the Jacobian

JuliaPythonRust
ode_componentsnot exportednot exported

Julia

ode_components(input; model_name, build_kwargs)
ode_components(input; model_name = nothing, build_kwargs = NamedTuple())
    -> (f!, jac!, jac_prototype, tgrad!, u0, p, var_map, jacobian)

Everything a stiff ODE solver needs, with no solver dependency:

  • f! — the tree-walk RHS, f!(du, u, p, t).
  • jac! — the prepared analytical Jacobian, jac!(J, u, p, t), filling the nonzeros of a matrix shaped like jac_prototype in place.
  • jac_prototype::SparseMatrixCSC{Float64} — the fixed structural (point-independent) pattern with stored zeros, ready to hand to a solver.
  • tgrad! — the analytical time gradient, tgrad!(dT, u, p, t) filling ∂f/∂t in place (wrt = :time through the same band calculus). For a system whose RHS never reads t this is a zero fill with no second evaluator built.
  • u0, p — the document’s initial state and parameter values.
  • var_map — state-element name → index in u.
  • jacobian::JacobianEvaluator — the underlying prepared evaluator (pattern, band entries, detected structure, …).

input is an EsmFile (with model_name when it holds several models) or a FlattenedSystem. Always wrt = :states — that is the Jacobian an ODE solver consumes. Wrap the pieces yourself for any solver interface, or load SciMLBase and call odefunction / odeproblem.

Source

Python

Python does not export this function.

Rust

Rust does not export this function.