aquakin.ParticleTrackReactor#
- class aquakin.ParticleTrackReactor(model, track, *, n_save=None, rtol=1e-06, atol=None, integrator=IntegratorConfig(order=3, factormax=3.0, colored_jacobian='auto', dtmax=None, max_steps=100000, solver=None), diff=DifferentiationConfig(mode='reverse', method='stable', check_finite=True, adjoint_max_steps=100000, adjoint_low_memory=False))[source]#
Bases:
GradientCheckMixinIntegrate chemistry along a single particle track.
- Parameters:
model (CompiledModel)
track (Track) – Time series of condition values along the particle path. Must supply every field declared in
model.conditions_required.n_save (int, optional) – Number of times at which to record the solution between
t[0]andt[-1]. Defaults to the number of track sample points.rtol (float, optional) – Relative tolerance for the ODE solver.
atol (float or jnp.ndarray, optional) – Absolute tolerance, scalar or shape
(n_species,). Defaults toNone-> a per-component noise floor scaled off the model reference concentrations (seeBatchReactor).integrator (IntegratorConfig, optional) – Integrator / step-size configuration (ESDIRK
order,factormax,dtmax,max_steps, an explicitsolver). SeeBatchReactor. Setdtmaxfor reverse-mode differentiation of a stiff model.diff (DifferentiationConfig, optional) – Autodiff configuration (
mode,method). SeeBatchReactor.
- __init__(model, track, *, n_save=None, rtol=1e-06, atol=None, integrator=IntegratorConfig(order=3, factormax=3.0, colored_jacobian='auto', dtmax=None, max_steps=100000, solver=None), diff=DifferentiationConfig(mode='reverse', method='stable', check_finite=True, adjoint_max_steps=100000, adjoint_low_memory=False))[source]#
- Parameters:
model (CompiledModel)
track (Track)
n_save (int | None)
rtol (float)
integrator (IntegratorConfig)
diff (DifferentiationConfig)
- Return type:
None
Methods
__init__(model, track, *[, n_save, rtol, ...])check_gradient_finite(grad_value, *[, what])Raise a friendly error if a reverse-mode gradient is non-finite.
solve(C0, *[, params])Integrate the model along the track.