vivyd.solvers.Solver#

class Solver(verbose=False)[source]#

Bases: ABC

Abstract base class for numerical solvers of ordinary differential equations (ODEs). The class defines the common interface and structure for all solvers in the vivyd.solvers module, including both pure Python and Taichi-accelerated implementations.

Parameters:

verbose (bool)

Methods#

Solver.run(model, state0, t_tab, handle=None)[source]#

Run the integration process.

Parameters:
  • model (SolverCompatible) – The right-hand side of the system of ODEs, which takes the current time and state as arguments.

  • state0 (arrf64) – The initial state of the system.

  • t_tab (arrf64) – The array of time points used for integration.

  • handle (Callable | None) – A function that is called inside the model. Default is None.

Returns:

An array containing the state of the system at each time point in t_tab. Its shape is (len(t_tab), *state0.shape).

Return type:

arrf64

Raises:

TypeError: – If Taichi acceleration is used but the model does not support Taichi solvers.