ddt()#

ddt(states, *args, **kwargs)[source]#

Approximate the time derivatives for a chunk of snapshots with a finite difference scheme. Calls ddt_uniform() or ddt_nonuniform(), depending on the arguments.

Parameters
states(n, k) ndarray

States to estimate the derivative of. The jth column is a snapshot that corresponds to the jth time step, i.e., states[:, j] = x(t[j]).

dtfloat

The time step between the snapshots, i.e., t[j+1] - t[j] = dt.

orderint {2, 4, 6} (optional)

The order of the derivative approximation. See https://en.wikipedia.org/wiki/Finite_difference_coefficient.

t(k,) ndarray

The times corresponding to the snapshots. May or may not be uniformly spaced.

Returns
ddts(n, k) ndarray

Approximate time derivative of the snapshot data. The jth column is the derivative dx / dt corresponding to the jth snapshot, states[:, j].