ord6()

Contents

ord6()#

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

Sixth-order forward, central, and backward differences for estimating the first derivative.

Central differences are used where possible; forward differences are used for the first three points and backward differences are used for the last three points:

\[\begin{split}\frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_0} &\approx \frac{1}{60\delta t}( -147\q(t_0) + 360\q(t_{1}) - 450\q(t_{2}) + 400\q(t_{3}) - 225\q(t_{4}) + 72\q(t_{5}) - 10\q(t_{6})), \\ \frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_1} &\approx \frac{1}{60\delta t}( -10\q(t_0) - 77\q(t_{1}) + 150\q(t_{2}) - 100\q(t_{3}) + 50\q(t_{4}) - 15\q(t_{5}) + 2\q(t_{6})), \\ \frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_2} &\approx \frac{1}{60\delta t}( 2\q(t_0) - 24\q(t_{1}) - 35\q(t_{2}) + 80\q(t_{3}) - 30\q(t_{4}) + 8\q(t_{5}) - \q(t_{6})), \\ \\ \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}), \quad j = 3, \ldots, k - 4, \\ \\ \frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_{k-3}} &\approx \frac{1}{60\delta t}( \q(t_{k-7}) - 8\q(t_{k-6}) + 30\q(t_{k-5}) - 80\q(t_{k-4}) + 35\q(t_{k-3}) + 24\q(t_{k-2}) - 2\q(t_{k-1})), \\ \frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_{k-2}} &\approx \frac{1}{60\delta t}( -2\q(t_{k-7}) + 15\q(t_{k-6}) - 50\q(t_{k-5}) + 100\q(t_{k-4}) - 150\q(t_{k-3}) + 77\q(t_{k-2}) + 10\q(t_{k-1})), \\ \frac{\textup{d}}{\textup{d}t}\q(t)\bigg|_{t = t_{k-1}} &\approx \frac{1}{60\delta t}( 10\q(t_{k-7}) - 72\q(t_{k-6}) + 225\q(t_{k-5}) - 400\q(t_{k-4}) + 450\q(t_{k-3}) - 360\q(t_{k-2}) + 147\q(t_{k-1})),\end{split}\]

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

State snapshots.

ddts(r, k) ndarray

Time derivative estimates corresponding to the state snapshots.

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

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