Geology Reference
In-Depth Information
f
i+1
f
i
f
i-1
x x x
i-1 i i+1
Figure 4.2.5. Finite difference discretizations.
Taylor series analysis shows that Equation 4.2.58 for the second derivative
is second-order accurate in
x. The O(
x) 2 describes the order of the
truncation error; if
x is small , then O(
x) 2 may be regarded as being very
small . Likewise, it can be shown that
df(x i )/dx = {f i+1 - f i-1 }/(2 x) + O( x) 2 (4.2.59)
for the first derivative, is second order accurate. Equations 4.2.58 and 4.2.59 are
“central difference” representations for the respective quantities at x i because
they involve left and right quantities at x i-1 and x i+1 . Note that the “backward
difference” formula
d 2 f(x i )/dx 2 = { f i - 2f i-1 + f i-2 }/( x) 2 + O( x) (4.2.60)
for the second derivative is not incorrect. It is not as accurate as the central
difference formula, since it turns out to be first-order accurate, the error being
only somewhat small . Similar comments apply to the “forward differencing”
d 2 f(x i )/dx 2 = { f i - 2f i+1 + f i+2 }/(
x) 2 + O(
x)
(4.2.61)
Alternative representations for Equation 4.2.59 are the backward and forward
difference formulas
df(x i )/dx = {f i - f i-1 }/
x + O(
x)
(4.2.62)
df(x i )/dx = {f i+1 - f i }/ x + O(
x)
(4.2.63)
Search WWH ::




Custom Search