2.1 Accuracy and Consistency
37
that the truncation error of the centered difference is of higher order does not,
however, guarantee that it will always generate a more accurate estimate of the
derivative. If the function is sufficiently rough and the grid spacing sufficiently
coarse, neither formula is Iikely to produce a good approximation, and the superiority of one over the other will be largely a matter of chance.
Higher-order finite-difference approximations can be constructed by including
additional grid points in the finite-difference formula . Suppose, for example, that
one wishes to obtain a fourth-order approximation to df/dx by determining the
five coefficients a, b, ... , e that satisfy
df (xo) = af{xo + 2ßx) + bf{xo + ßX) + cf{xo)
dx
+ d Itx« - ßX) + ef{xo - 2ßx) + 0 [(ßx)4].
(2.5)
Expanding f{xo ± ßX) and f{xo ± 2ßx) in Taylor series, substituting those
expansions into (2.5), and equating the coefficients of like powers of Sx yields
five equations for the unknown coefficients:
a + b + c + d + e = 0,
2a+b-d-2e= l/ßx,
4a + b + d + 4e = 0,
8a + b - d - 8e = 0,
16a + b + d + 16e = 0.
The unique solution to this system requires c = °and yields an approx imation to
the derivative of the form
df x _
dx ( 0) - 3
(f{XO + ßX) - f{xo - ßX»)
2ßx
(2.6)
3
4ßx
Similar procedures can be used to generate even higher-order formulae , off-centered formulae , and formulae for irregular grid intervals.
As an alternative to the brute force manipulation ofTaylor series, the derivation
of higher-order finite-difference formulae can be facilitated by the systematic use
of operator notation and simple lower-order formulae. A simpler derivation of
(2.6) may be obtained by defining a finite-difference operator onx such that
f{x + nßx/2) - f{x - nßx/2)
f
.
(2.7)
nßx
Using this notation, the second-order centered difference satisfies
Précédent

- 52/476

Suivant