Version: v0.2.0

Differentiate a model

Take a model or flattened system, differentiate its right-hand side, and get back structured Jacobian bands.

OperationKindBindingsSummary
dscalarfunctionJulia, Python, RustDerivative of the scalar expression e with respect to site s, as a new ESM expression.
extended_bandsfunctionPython, RustThe extended first-order system of axis wrt (spec §4.5, ExtendedBands): every state equation’s bands with respect to the axis’s targets and the active recurrences, and each…
forcing_namesfunctionJulia, Python, RustThe forcing set of a system, sorted by name: the parameters whose cells are the columns of the wrt = :forcing axis (esm-jacobian-spec.md §4.3).
jacobian_bandsfunctionJulia, Python, RustDifferentiate every differential equation of the system with respect to every state (wrt = :states), every parameter outside the forcing set (wrt = :parameters, scalar and…
jacobian_bands2functionJulia, Python, RustSecond-order bands for the axis pair wrt = (a1, a2), a1 ∈ (:states, :time) and a2 ∈ (:states, :parameters, :forcing): every first-order entry of the a1 axis…
jacobian_columnsfunctionJulia, Python, RustThe column space of a :parameters or :forcing block: each column variable with its integer shape (Int[] for a scalar), sorted by name — the columns field of the emitted…
recurrencesfunctionPython, RustEvery recurrence of the view, in equation order: each observed whose definition reads itself, with its frame and axis read off the definition.
simplify_branchesfunctionJulia, Python, RustConditional-specific simplification, complementing EarthSciAST.simplify:
sysviewfunctionJulia, Python, RustView a model of an EsmFile, or a FlattenedSystem, for differentiation.
transfer_definitionfunctionPython, RustThe transfer recurrence T of rec (spec §4.5): over the frame plus one output index j on the axis, T[o, k, j] = [k == j] + Σ_{self bands} coef · T[o, k − lag, j], so `T[o,…
bandtypeJulia, Python, RustOne structured block of ∂(rhs of the equation for u)/∂v:
jac_entrytypeJulia, Python, RustOne band of the model Jacobian: ∂(equation for state u)/∂v`` with its Band.
jac_entry2typeJulia, Python, RustOne second-order band: ∂²(equation for u)/∂v ∂w.
sitetypeJulia, Python, RustThe thing a scalar derivative is taken with respect to: a bare VarExpr (scalar variable) or an index(v, i…) node (one symbolic cell of an array variable).
sys_viewtypeJulia, Python, RustUniform system view: variables (name → ModelVariable), equations, and the document’s index_sets.
band_errorerrorJulia, Python, RustAn expression has a form the band calculus cannot differentiate (for example a filtered faq node or a non-"+" semiring).
derivative_rule_errorerrorJulia, Python, RustA scalar operator has no derivative rule (spec §3).

All topics