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: GradientCheckMixin

Integrate 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] and t[-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 to None -> a per-component noise floor scaled off the model reference concentrations (see BatchReactor).

  • integrator (IntegratorConfig, optional) – Integrator / step-size configuration (ESDIRK order, factormax, dtmax, max_steps, an explicit solver). See BatchReactor. Set dtmax for reverse-mode differentiation of a stiff model.

  • diff (DifferentiationConfig, optional) – Autodiff configuration (mode, method). See BatchReactor.

__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:
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.

solve(C0, *, params=None)[source]#

Integrate the model along the track.

Parameters:
  • C0 (jnp.ndarray) – Inlet concentration vector, shape (n_species,).

  • params (jnp.ndarray, optional) – Flat parameter vector. Defaults to model.default_parameters().

Return type:

TrackSolution