bwd5()

Contents

bwd5()#

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

Fifth-order backward difference for estimating the first derivative.

\[\frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_j} \approx \frac{1}{60\delta t}(137\q(t_j) - 300\q(t_{j-1}) + 300\q(t_{j-2}) - 200\q(t_{j-3}) + 75\q(t_{j-4}) - 12\q(t_{j-5}))\]

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 - 5) ndarray

State snapshots, excluding the first five snapshots.

ddts(r, k - 5) ndarray

Time derivative estimates corresponding to the state snapshots.

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

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