Data handling
dynax.differentiate(ts, ys)
Approximate the derivatives of a timeseries via cubic interpolation.
PARAMETER | DESCRIPTION |
---|---|
ts
|
The time of each observation.
TYPE:
|
ys
|
The observations themselves. Should use NaN to indicate missing data.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
PyTree of derivatives of |
dynax.Trajectory
Simple dataclass for storing trajectory like data.
The fields are
- ts: Timestamps, (typically) expected shape (...,)
- ys: State vectors, (typically) expected shape (..., n)
- y_ts: State derivatives, (typically) expected shape (..., n)
- us: Inputs/Excitations, (typically) expected shape (..., m)
__init__(ts=None, ys=None, *, y_ts=None, us=None, dtype=None)
Initialize a Trajectory and converts all arrays to jax arrays.
PARAMETER | DESCRIPTION |
---|---|
ts
|
Timestamps. Defaults to None.
TYPE:
|
ys
|
States. Defaults to None.
TYPE:
|
y_ts
|
State derivatives. Defaults to None.
TYPE:
|
us
|
Input/Exciataions. Defaults to None.
TYPE:
|
dtype
|
Data type of the arrays after conversion to jax arrays. Defaults to None.
TYPE:
|
__getitem__(index)
Index all fields simultaniously.
PARAMETER | DESCRIPTION |
---|---|
index
|
Any index into a
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dynax.Trajectory
|
Trajectory with every field indexed by |
stack(trajectories, axis=0, dtype=None)
staticmethod
Broadcasted stacking of trajectories.
PARAMETER | DESCRIPTION |
---|---|
trajectories
|
Sequence of trajectories to stack.
TYPE:
|
axis
|
Axis along which to stack. Defaults to 0.
TYPE:
|
dtype
|
Optional dtype of the resulting array. If not specified, the dtype will be determined via type promotion rules described in type-promotion. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dynax.Trajectory
|
Trajectory containing the stacked arrays. |