Вы находитесь на странице: 1из 2

CENTRAL DIFFERENCES

Fig.1 Consider the analytic function shown in Fig. 1. The forward and backward Taylor series expansions about x are respectively f ( x + h) = f ( x) + hf ( x) + f ( x h) = f ( x) hf ( x) + h2 h3 ( x) + f f ( x) + L 2! 3! h2 h3 ( x) f f ( x) + L 2! 3! (1) (2)

Subtracting the backward expansion (2) from the forward expansion (1), we note that the terms involving even powers of h, such as (h2/2!) f "(x), cancel, yielding f ( x + h) f ( x h) = 2hf ( x) + or, solving for f (x) , h3 f ( x) + L 3 (3)

f ( x) = or

f ( x + h) f ( x h) h 2 f ( x) + L 2h 6

(4)

f ( x) =

f ( x + h) f ( x h) + ( h 2 ) + L 2h

(5)

Employing subscript notation, f ( x) = f j +1 f j 1 2h + ( h 2 ) (6)

This difference representation, called a central difference representation, is accurate to O(h2). Note that the point x itself is not involved, and that from the error term in (4), this expression is exact for polynomials of degree 2 (parabolas) and lower. An

expression of O(h2) for f "(x) is readily obtainable from (1) and (2) by adding these equations and solving for f"(x) to yield
f ( x) = f j +1 2 f j + f j 1 h
2

+ ( h 2 )

(7)

To obtain f '"(x) and f iv(x) requires one additional Taylor series expansion in each direction and some manipulations similar to those carried out to obtain f (x) and f "(x). The central difference expressions of O(h2) for derivatives up to the fourth order are tabulated in Fig. 2a. Note that the value of f (x)(fj) itself is missing from all of the representations for odd derivatives. A convenient memory aid for these central difference expressions of O(h2) in terms of ordinary forward and backward differences is given by
n n d n f f j + n / 2 + f j n / 2 = + (h 2 ) , n even n n dx 2h n n df n f j +( n1) / 2 + f j ( n1) / 2 = + (h 2 ) , n odd n n dx 2h

(8)

(9)

fj-2 2hf (xj) = h2f "(xj) = 2h f '"(xj) = h f (xj) =


4 iv 3

fj-1 -1 1

fj 0 -2 0 6

fj+1 1 1 -2 -4

fj+2

+ O(h)2 1 1

-1 1

2 -4

(a) Representations of O(h)2


fj-3 12hf (xj) = 12h f "(xj) = 8h3f '"(xj) = 6h f (xj) =
4 iv 2

fj-2 1 -1

fj-1 -8 16 13 -7

fj 0 -30 0 56

fj+1 8 16 -13 -7
4

fj+2 -1 -1 8 12

fj+3

+ O(h)4 -1 -1

1 -1

-8 12

(b) Representations of O(h) Fig. 2

Central difference expressions of O(h4) may be obtained by employing many tedious operations with the Taylor series expansions which will not be repeated here. These expressions for derivatives up to order four are tabulated in Fig. 2b. It should be noted that a complete operator approach to central differences can also be defined, but this approach seems somewhat artificial and overly complicated for practical purposes.

Вам также может понравиться