13.07.2015 Views

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

27.5 FINITE DIFFERENCESmany values of ξ i <strong>for</strong> each value of y <strong>and</strong> is a very poor approximation if thewings of the Gaussian distribution have to be sampled accurately. For nearly allpractical purposes a Gaussian look-up table is to be preferred.27.5 Finite differencesIt will have been noticed that earlier sections included several equations linkingsequential values of f i <strong>and</strong> the derivatives of f evaluated at one of the x i .Inthis section, by way of preparation <strong>for</strong> the numerical treatment of differentialequations, we establish these relationships in a more systematic way.Again we consider a set of values f i of a function f(x) evaluated at equallyspaced points x i , their separation being h. As be<strong>for</strong>e, the basis <strong>for</strong> our discussionwill be a Taylor series expansion, but on this occasion about the point x i :f i±1 = f i ± hf i ′ + h22! f′′ i ± h33! f(3) i + ··· . (27.56)In this section, <strong>and</strong> subsequently, we denote the nth derivative evaluated at x iby f (n)i .From (27.56), three different expressions that approximate f (1)ican be derived.The first of these, obtained by subtracting the ± equations, is( )f (1) dfi≡ = f i+1 − f i−1dx 2hx i− h23! f(3) i− ··· . (27.57)The quantity (f i+1 − f i−1 )/(2h) is known as the central difference approximationto f (1)i<strong>and</strong> can be seen from (27.57) to be in error by approximately (h 2 /6)f (3)i.An alternative approximation, obtained from (27.56+) alone, is given by( )f (1) dfi ≡ = f i+1 − f i− h dxx ih 2! f(2) i − ··· . (27.58)The <strong>for</strong>ward difference approximation, (f i+1 − f i )/h, is clearly a poorer approximation,since it is in error by approximately (h/2)f (2)i as compared with (h 2 /6)f (3)i .Similarly, the backward difference (f i − f i−1 )/h obtained from (27.56−) is not asgood as the central difference; the sign of the error is reversed in this case.This type of differencing approximation can be continued to the higher derivativesof f in an obvious manner. By adding the two equations (27.56±), a centraldifference approximation to f (2)i can be obtained:(f (2) d 2 )fi≡dx 2 ≈ f i+1 − 2f i + f i−1h 2 . (27.59)The error in this approximation (also known as the second difference of f) iseasilyshowntobeabout(h 2 /12)f (4)i.Of course, if the function f(x) is a sufficiently simple polynomial in x, all1019

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!