vivyd.models.VIVModel#

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

Bases: SolverCompatible, ABC

Base class for vortex-induced vibration (VIV) models. All VIV models must inherit from this class to implement its attributes and methods, necessary for having a common interface.

Methods#

VIVModel.__call__(t, state, handle=<function VIVModel.<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

abstractmethod VIVModel.rhs(t, state, handle=<function VIVModel.<lambda>>)[source]#
Parameters:
  • t (float)

  • state (arrf64)

  • handle (Callable)

Return type:

arrf64

VIVModel.validate_state(state)[source]#

Validate the shape of the state vector.

Parameters:

state (arrf64) – State vector.

Returns:

Validated state vector.

Return type:

arrf64

Raises:

ValueError – If the state vector has an invalid shape.