In numerical analysis, Richardson extrapolation is a sequence acceleration method used to improve the rate of convergence of a sequence of estimates of some value
A\ast=\limh\toA(h)
A(h)
h
A\ast
h=0
\pi
Practical applications of Richardson extrapolation include Romberg integration, which applies Richardson extrapolation to the trapezoid rule, and the Bulirsch–Stoer algorithm for solving ordinary differential equations.
Let
A0(h)
A*
ai
ki
ki | |
h |
>
ki+1 | |
h |
ki | |
O(h |
)
Ai(h)
A*=
ki | |
A | |
i(h)+O(h |
).
ki | |
A | |
i(h)+O(h |
),
Ai(h)
ki | |
O(h |
)
Note that by simplifying with Big O notation, the following formulae are equivalent:
Richardson extrapolation is a process that finds a better approximation of
A*
k0 | |
A | |
0(h)+O(h |
)
A*=A1(h)+
k1 | |
O(h |
).
A0(h)
A1(h)
k0 | |
O(h |
)
k1 | |
O(h |
)
h
Ai(h)
Aj(h)
i>j
A*
k0 | |
O(h |
)
Using the step sizes
h
h/t
t
A*
To improve our approximation from
k0 | |
O(h |
)
k1 | |
O(h |
)
k0 | |
t |
k1 | |
O(h |
)
k0 | |
(t |
-1)A*
A*
A*=
k1 | |
A | |
1(h)+O(h |
)
A general recurrence relation can be defined for the approximations bywhere
ki+1
The Richardson extrapolation can be considered as a linear sequence transformation.
Additionally, the general formula can be used to estimate
k0
A*
A*
h
h/t
h/s
k0
h
s
t
As
t ≠ 1
t>0
s
s=t2
k0 | |
t |
k0
h
t
Suppose that we wish to approximate
A*
A(h)
h
Let us define a new functionwhere
h
h | |
t |
Then
R(h,t)
O(hn+1)
A(h)
Very often, it is much easier to obtain a given precision by using R(h) rather than A(h′) with a much smaller h′. Where A(h′) can cause problems due to limited precision (rounding errors) and/or due to the increasing number of calculations needed (see examples below).
The following pseudocode in MATLAB style demonstrates Richardson extrapolation to help solve the ODE
y'(t)=-y2
y(0)=1
h
t=2
t
4=22=t2
y(5)
1 | |
5+1 |
=
1 | |
6 |
=0.1666...
y(t)=
1 | |
1+t |
Trapezoidal(f, tStart, tEnd, h, y0)
exists which attempts to compute y(tEnd)
by performing the trapezoidal method on the function f
, with starting point y0
and tStart
and step size h
.Note that starting with too small an initial step size can potentially introduce error into the final solution. Although there are methods designed to help pick the best initial step size, one option is to start with a large step size and then to allow the Richardson extrapolation to reduce the step size each iteration until the error reaches the desired tolerance.
% Don't allow the iteration to continue indefinitelymaxRows = 20% Pick an initial step sizeinitialH = tStart - tEnd% Were we able to find the solution to within the desired tolerance? not yet.haveWeFoundSolution = false
h = initialH
% Create a 2D matrix of size maxRows by maxRows to hold the Richardson extrapolates% Note that this will be a lower triangular matrix and that at most two rows are actually% needed at any time in the computation.A = zeroMatrix(maxRows, maxRows)
% Compute the top left element of the matrix.% The first row of this (lower triangular) matrix has now been filled.A(1, 1) = Trapezoidal(f, tStart, tEnd, h, y0)
% Each row of the matrix requires one call to Trapezoidal% This loops starts by filling the second row of the matrix,% since the first row was computed abovefor i = 1 : maxRows - 1 % Starting at i = 1, iterate at most maxRows - 1 times % Halve the previous value of h since this is the start of a new row. h = h/2
% Starting filling row i+1 from the left by calling % the Trapezoidal function with this new smaller step size A(i + 1, 1) = Trapezoidal(f, tStart, tEnd, h, y0)
% Go across this current (i+1)-th row until the diagonal is reached for j = 1 : i % To compute A(i + 1, j + 1), which is the next Richardson extrapolate, % use the most recently computed value (i.e. A(i + 1, j)) % and the value from the row above it (i.e. A(i, j)).
A(i + 1, j + 1) = ((4^j).*A(i + 1, j) - A(i, j))/(4^j - 1); end % After leaving the above inner loop, the diagonal element of row i + 1 has been computed % This diagonal element is the latest Richardson extrapolate to be computed. % The difference between this extrapolate and the last extrapolate of row i is a good % indication of the error. if (absoluteValue(A(i + 1, i + 1) - A(i, i)) < tolerance) % If the result is within tolerance % Display the result of the Richardson extrapolation print("y = ", A(i + 1, i + 1)) haveWeFoundSolution = true % Done, so leave the loop break endend
% If we were not able to find a solution to within the desired toleranceif (not haveWeFoundSolution) print("Warning: Not able to find solution to within the desired tolerance of ", tolerance); print("The last computed extrapolate was ", A(maxRows, maxRows))end