vivyd.solvers.SolverCompatible#

class SolverCompatible(*args, **kwargs)[source]#

Bases: Protocol

Attributes#

SolverCompatible.state_size: int#

Number of state variables in the model.

Methods#

SolverCompatible.__call__(t, state, handle=<function <lambda>>)[source]#

Evaluate the model at a given time and state. The handle is a function that can be called inside the model to provide additional functionality.

Parameters:
  • t (float) – The current time.

  • state (arrf64) – The current state of the system, as a one-dimensional array, the length of which must be equal to the state_size attribute of the model.

  • handle (Callable) – A function that can be called inside the model to provide additional functionality. Default is a no-op function.

Returns:

The derivatives of the state variables, as a one-dimensional array, the length of which must be equal to the state_size attribute of the model.

Return type:

arrf64