utils module

simupy.utils.array_callable_from_vector_trajectory(tt, x, unraveled, raveled)[source]

Convert a trajectory into an interpolating callable that returns a 2D array. The unraveled, raveled pair map how the array is filled in. See riccati_system example.

Parameters:
  • tt (1D array_like) – Array of m time indices of trajectory
  • xx (2D array_like) – Array of m x n vector samples at the time indices. First dimension indexes time, second dimension indexes vector components
  • unraveled (1D array_like) – Array of n unique keys matching xx.
  • raveled (2D array_like) – Array where the elements are the keys from unraveled. The mapping between unraveled and raveled is used to specify how the output array is filled in.
Returns:

matrix_callable – The callable interpolating the trajectory with the specified shape.

Return type:

callable

simupy.utils.callable_from_trajectory(t, curves)[source]

Use scipy.interpolate splprep to build cubic b-spline interpolating functions over a set of curves.

Parameters:
  • t (1D array_like) – Array of m time indices of trajectory
  • curves (2D array_like) – Array of m x n vector samples at the time indices. First dimension indexes time, second dimension indexes vector components
Returns:

interpolated_callable – Callable which interpolates the given curve/trajectories

Return type:

callable