InterpDerivativeEstimator#
- class InterpDerivativeEstimator(time_domain: ndarray, InterpolatorClass='cubic', new_time_domain: ndarray = None, **options)[source]#
Time derivative estimator based on interpolation.
For a set of (compressed) snapshots \(\Qhat = [~\qhat_0~~\cdots~~\qhat_{k-1}~] \in \RR^{r \times k}\), this class forms one-dimensional differentiable interpolants for each of the \(r\) rows of \(\Qhat\).
- Parameters:
- time_domain(k,) ndarray
Time domain of the snapshot data.
- InterpolatorClassstr or scipy.interpolate class
Class for performing the interpolation. Must obey the following syntax:
>>> intrp = InterpolatorClass(time_domain, states, **options) >>> new_states = intrp(new_time_domain, 0) >>> state_ddts = intrp(new_time_domain, 1)
The following strings are also accepted.
"cubic"
(default): usescipy.interpolate.CubicSpline
."akima"
: usescipy.interpolate.Akima1DInterpolator
. This is a local interpolation method and is more resitant to outliers thanscipy.interpolate.CubicSpline
. However, it is not recommended if the time points are not uniformly spaced."pchip"
: usescipy.interpolate.PchipInterpolator
. The interpolator preserves monotonicity in the interpolation data and does not overshoot if the data is not smooth.
- new_time_domain(k’,) ndarray or None
If given, evaluate the interpolator at these points to generate new state snapshots and corresponding time derivatives. If input snapshots are also given, interpolate them as well and evaluate the interpolant at these new points. The new_time_domain should lie within the range of the original time_domain; a warning is raised if extrapolation is requested.
- optionsdict
Keyword arguments for the constructor of the
InterpolatorClass
.
Properties:- InterpolatorClass#
One-dimensional differentiable interpolator class.
- new_time_domain#
Time domain at which to evaluate the interpolator and its first derivative.
- options#
Keyword arguments for the constructor of the
InterpolatorClass
.
- time_domain#
Time domain of the snapshot data, a (k,) ndarray.
Methods:Estimate the first time derivatives of the states.
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 that
estimate()
is consistent in the sense that the all outputs have the same number of columns.