Project

EarthSciASTDiff

Analytical sparse Jacobians for EarthSciAST (.esm) models by symbolic differentiation of the expression AST.

Contents

This is the documentation for the older version v0.7.0. For the latest release, see v0.8.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_bandsfunctionJulia, Python, RustThe extended first-order system of axis wrt (esm-jacobian-spec.md §4.5, ExtendedBands): every state equation’s bands with respect to the axis’s targets and the active…
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…
recurrencesfunctionJulia, Python, RustEvery recurrence of the view (esm-jacobian-spec.md §4.5), 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, Rustdata_sources (a document’s data_sources, name → DataSource) is what the derived documents copy for each data-fed parameter (esm-jacobian-spec.md §8.1).
transfer_definitionfunctionJulia, Python, RustThe transfer recurrence T of rec (esm-jacobian-spec.md §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 −…
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, the document’s index_sets, its domain (nothing when it has none; the evaluation document carries its…
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