dynax.evolution

Classes for simulating the evolution of dynamical systems over time.

Classes

AbstractEvolution(system)

Abstract base-class for evolutions.

Flow(system[, solver, stepsize_controller])

Evolution for continous-time dynamical systems.

Map(system)

Evolution for discrete-time dynamical systems.

class dynax.evolution.AbstractEvolution(system)[source]

Bases: Module

Abstract base-class for evolutions.

Evolutions combine dynamical systems with a solver. They simulate the evolution of the system state and output over time given an initial and, possibly, an input sequence.

abstractmethod __call__(t, u, initial_state)[source]

Evolve an initial state along the vector field and compute output.

Parameters:
  • t (Array) – Times at which to evaluate the evolution.

  • u (Array | None) – Optional input sequence of same length.

  • initial_state (Array | None) – Optional, fixed initial state used instead of AbstractSystem.initial_state.

Returns:

tuple[Array, Array] – Tuple (x, y) of state and output sequences.

class dynax.evolution.Flow(system, solver=<factory>, stepsize_controller=<factory>)[source]

Bases: AbstractEvolution

Evolution for continous-time dynamical systems.

Parameters:
__call__(t, u=None, initial_state=None, *, ufun=None, ucoeffs=None, **diffeqsolve_kwargs)[source]

Evolve an initial state along the vector field and compute output.

Parameters:
  • t (ArrayLike) – Times at which to evaluate the evolution.

  • u (ArrayLike | None) – Optional input sequence of same length.

  • initial_state (ArrayLike | None) – Optional, fixed initial state used instead of AbstractSystem.initial_state.

  • ufun (Callable[[float], Array] | None) – A function \(t \mapsto u\). Can be used instead of u or ucoeffs.

  • ucoeffs (tuple[PyTree, PyTree, PyTree, PyTree] | None) – Precomputed spline coefficients of the input passed to diffrax.CubicInterpolation. Can be used instead of u or ufun.

  • **diffeqsolve_kwargs – Additional arguments passed to diffrax.diffeqsolve().

Returns:

tuple[Array, Array] – Tuple (x, y) of state and output sequences.

class dynax.evolution.Map(system)[source]

Bases: AbstractEvolution

Evolution for discrete-time dynamical systems.

Parameters:

system (AbstractSystem) – Dynamical system.

__call__(t=None, u=None, initial_state=None, *, num_steps=None)[source]

Evolve an initial state along the vector field and compute output.

Parameters:
  • t (ArrayLike | None) – Times at which to evaluate the evolution.

  • u (ArrayLike | None) – Optional input sequence of same length.

  • initial_state (ArrayLike | None) – Optional, fixed initial state used instead of AbstractSystem.initial_state.

  • num_steps (int | None) – Number of steps to compute if t and u are not specified.

Returns:

tuple[Array, Array] – Tuple (x, y) of state and output sequences.