5.1.3.3. numdifftools.extrapolation.dea3¶
-
dea3
(v0, v1, v2, symmetric=False)[source]¶ Extrapolate a slowly convergent sequence
Parameters: - v0, v1, v2 : array-like
3 values of a convergent sequence to extrapolate
Returns: - result : array-like
extrapolated value
- abserr : array-like
absolute error estimate
See also
dea
Notes
DEA3 attempts to extrapolate nonlinearly to a better estimate of the sequence’s limiting value, thus improving the rate of convergence. The routine is based on the epsilon algorithm of P. Wynn, see [1].
References
[1] (1, 2) C. Brezinski and M. Redivo Zaglia (1991) “Extrapolation Methods. Theory and Practice”, North-Holland. [2] C. Brezinski (1977) “Acceleration de la convergence en analyse numerique”, “Lecture Notes in Math.”, vol. 584, Springer-Verlag, New York, 1977. [3] E. J. Weniger (1989) “Nonlinear sequence transformations for the acceleration of convergence and the summation of divergent series” Computer Physics Reports Vol. 10, 189 - 371 http://arxiv.org/abs/math/0306302v1 Examples
# integrate sin(x) from 0 to pi/2
>>> import numpy as np >>> import numdifftools as nd >>> Ei= np.zeros(3) >>> linfun = lambda i : np.linspace(0, np.pi/2., 2**(i+5)+1) >>> for k in np.arange(3): ... x = linfun(k) ... Ei[k] = np.trapz(np.sin(x),x) >>> [En, err] = nd.dea3(Ei[0], Ei[1], Ei[2]) >>> truErr = np.abs(En-1.) >>> np.all(truErr < err) True >>> np.allclose(En, 1) True >>> np.all(np.abs(Ei-1)<1e-3) True