ctr6()

Contents

ctr6()#

ctr6(states: ndarray, dt: float, inputs=None)[source]#

Sixth-order central difference for estimating the first derivative.

\[\frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_j} \approx \frac{1}{60\delta t} (-\q(t_{j-3}) + 9\q(t_{j-2}) - 45\q(t_{j-1}) + 45\q(t_{j+1})) - 9\q(t_{j+2}) + \q(t_{j+3})\]

where \(\delta t = t_{j+1} - t_j\) for all \(j\).

Parameters:
states(r, k) ndarray

State snapshots: states[:, j] is the state at time \(t_j\).

dtfloat

Time step between snapshots.

inputs(m, k) or (k,) ndarray or None

Inputs corresponding to the states, if applicable.

Returns:
_states(r, k - 6) ndarray

State snapshots, excluding the first three and last three snapshots.

ddts(r, k - 6) ndarray

Time derivative estimates corresponding to the state snapshots.

_inputs(m, k - 6) or (k - 6,) ndarray or None

Inputs corresponding to _states, if applicable. Only returned if inputs is not None.