aquakin.IntegratorConfig#

class aquakin.IntegratorConfig(order=3, factormax=3.0, colored_jacobian='auto', dtmax=None, max_steps=100000, solver=None)[source]#

Bases: object

The integrator / step-size configuration for a solve.

A single frozen value object centralising the per-step solver settings that used to be scattered as loose keyword arguments on Plant.solve and the reactor constructors. Passed as integrator=IntegratorConfig(...); the default flips the public solve stack to the fast configuration (Kvaerno3 + a capped step-growth factor + an auto colored Jacobian).

rtol / atol are deliberately not here – they stay separate arguments of Plant.solve / the reactor constructors (a tolerance is the accuracy contract, not the integrator machinery).

Parameters:
  • order (int) – ESDIRK order: 3 -> Kvaerno3 (the new fast default, fewer stages), 5 -> Kvaerno5 (the robust higher-order method). Ignored when solver is given.

  • factormax (float, optional) – Cap on the PID controller’s per-step growth factor (diffrax default 10). A smaller cap (default 3) damps the overshoot-then-reject oscillation on a stiff forced system. None keeps the diffrax default.

  • colored_jacobian ({"auto", True, False}) – Sparse (colored-AD) materialisation of the per-step implicit Jacobian. See Plant.solve for the full semantics. Plant-only – reactors ignore it.

  • dtmax (float, optional) – Maximum integrator step size (None = uncapped). Set it for a reverse-mode gradient through a stiff solve (the through_solve differentiation method); the cap-free stable method does not need it.

  • max_steps (int) – Maximum number of internal solver steps.

  • solver (diffrax.AbstractSolver, optional) – An explicit solver object that overrides order and is honoured verbatim (the one escape hatch). None builds the canonical solver of order.

__init__(order=3, factormax=3.0, colored_jacobian='auto', dtmax=None, max_steps=100000, solver=None)#
Parameters:
  • order (int)

  • factormax (float | None)

  • colored_jacobian (bool | str)

  • dtmax (float | None)

  • max_steps (int)

  • solver (AbstractSolver | None)

Return type:

None

Methods

__init__([order, factormax, ...])

Attributes

colored_jacobian

dtmax

factormax

max_steps

order

solver