UniformFiniteDifferencer#

class UniformFiniteDifferencer(time_domain, scheme: str = '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

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().

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.

mask

Map an array from the training time domain to the domain of the estimated time derivatives.

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.