vivyd.excitation.Excitation#

class Excitation(x, dt)[source]#

Bases: TaichiCompatible

A class for representing any signal that can be interpolated and used to affect models.

Parameters:
  • x (arrf64) – A 1D array containing the signal values at discrete time points.

  • dt (float) – The time step between the discrete time points corresponding to the signal values in x.

  • Important:: (..) – To benefit from Taichi acceleration, ensure that the Excitation class is instantiated within a Taichi context.

Attributes#

property Excitation.x#

Methods#

Excitation.interpolate(t)[source]#

Interpolate the signal at a given time point.

Parameters:

t (float) – A time point at which to interpolate the signal.

Returns:

The interpolated signal value at the specified time point. specified time points.

Return type:

float

Raises:

ValueError – If any time point in t is outside the range [0, (n-1)*dt], where n is the number of discrete time points in x.

Excitation.__call__(t)[source]#

Shorthand for interpolate().

Parameters:

t (float)

Return type:

float