Computational Physics - Department of Physics

(Axel Boer) #1

64 3 Numerical differentiation and interpolation


3.2.2 Richardson’s deferred extrapolation method


Here we present an elegant method to improve the precision ofour mathematical truncation,
without too many additional function evaluations. We will again study the evaluation of the
first and second derivatives ofexp(x)at a given pointx=ξ. In Eqs. (3.3) and (3.4) for the first
and second derivatives, we noted that the truncation error goes likeO(h^2 j).
Employing the mid-point approximation to the derivative, the various derivativesDof a
given functionf(x)can then be written as


D(h) =D( 0 )+a 1 h^2 +a 2 h^4 +a 3 h^6 +...,

whereD(h)is the calculated derivative,D( 0 )the exact value in the limith→ 0 andaiare
independent ofh. By choosing smaller and smaller values forh, we should in principle be
able to approach the exact value. However, since the derivatives involve differences, we may
easily loose numerical precision as shown in the previous sections. A possible cure is to apply
Richardson’s deferred approach, i.e., we perform calculations with several values of the step
hand extrapolate toh= 0. The philososphy is to combine different values ofhso that the
terms in the above equation involve only large exponents forh. To see this, assume that we
mount a calculation for two values of the steph, one withhand the other withh/ 2. Then we
have
D(h) =D( 0 )+a 1 h^2 +a 2 h^4 +a 3 h^6 +...,


and


D(h/ 2 ) =D( 0 )+a^1 h

2
4
+a^2 h

4
16
+a^3 h

6
64

+...,

and we can eliminate the term witha 1 by combining


D(h/ 2 )+D(h/^2 )−D(h)
3
=D( 0 )−a^2 h

4
4
−^5 a^3 h

6
16

. (3.12)

We see that this approximation toD( 0 )is better than the two previous ones since the error
now goes likeO(h^4 ). As an example, let us evaluate the first derivative of a functionfusing a
step with lengthshandh/ 2. We have then


fh−f−h
2 h
=f 0 ′+O(h^2 ),

fh/ 2 −f−h/ 2
h
=f 0 ′+O(h^2 / 4 ),

which can be combined, using Eq. (3.12) to yield


−fh+ 8 fh/ 2 − 8 f−h/ 2 +f−h
6 h
=f 0 ′−
h^4
480
f(^5 ).

In practice, what happens is that our approximations toD( 0 )goes through a series of steps

D( 00 )
D( 01 )D( 10 )
D( 02 )D( 11 )D( 20 )
D( 03 )D( 12 )D( 21 )D( 30 )
... ... ... ...

,

where the elements in the first column represent the given approximations

Free download pdf