UniformFiniteDifferencer#

class UniformFiniteDifferencer(time_domain, scheme='ord4')[source]#

Time derivative estimation with finite differences for state snapshots spaced uniformly in time.

Parameters:
time_domain(k,) ndarray

Time domain corresponding to the snapshot data. This class requires uniformly spaced time domains, see NonuniformFiniteDifferencer for non-uniform domains.

schemestr or callable

Finite difference scheme to use. Options:

  • 'fwd1': first-order forward differences, see fwd1().

  • 'fwd2': second-order forward differences, see fwd2().

  • 'fwd3': third-order forward differences, see fwd3().

  • 'fwd4': fourth-order forward differences, see fwd4().

  • 'fwd5': fifth-order forward differences, see fwd5().

  • 'fwd6': sixth-order forward differences, see fwd6().

  • 'bwd1': first-order backward differences, see bwd1().

  • 'bwd2': second-order backward differences, see bwd2().

  • 'bwd3': third-order backward differences, see bwd3().

  • 'bwd4': fourth-order backward differences, see bwd4().

  • 'bwd5': fifth-order backward differences, see bwd5().

  • 'bwd6': sixth-order backward differences, see bwd6().

  • 'ctr2': second-order backward differences, see ctr2().

  • 'ctr4': fourth-order backward differences, see ctr4().

  • 'ctr6': sixth-order backward differences, see ctr6().

  • 'ord2': second-order differences, see ord2().

  • 'ord4': fourth-order differences, see ord4().

  • 'ord6': sixth-order differences, see ord6().

If scheme is a callable function, its signature must match the following syntax.

_states, ddts = scheme(states, dt)
_states, ddts, _inputs = scheme(states, dt, inputs)

Here dt is a positive float, the uniform time step. Each output should have the same number of columns.

Properties:
dt#

Time step.

scheme#

Finite difference engine.

time_domain#

Time domain of the snapshot data, a (k,) ndarray.

Methods:

estimate

Estimate the first time derivatives of the states using finite differences.

verify

Verify that estimate() is consistent in the sense that the all outputs have the same number of columns and test the accuracy of the results on a few test problems.

verify_shapes

Verify that estimate() is consistent in the sense that the all outputs have the same number of columns.