Graphics Programs Reference
In-Depth Information
( h 2 )errorin
Note that the truncation erroris now
O
( h ), which is not as goodas the
O
central difference approximations.
Wecan derive the approximationsfor higherderivatives in the same manner. For
example, Eqs. (a) and (c) yield
f ( x
+
2 h )
2 f ( x
+
h )
+
f ( x )
f ( x )
=
+ O
( h )
(5.7)
h 2
The third and fourth derivatives can be derivedinasimilar fashion. The results are
shown in Tables 5.2a and 5.2b.
f ( x )
f ( x
+
h )
f ( x
+
2 h )
f ( x
+
3 h )
f ( x
+
4 h )
hf ( x )
1
1
h 2 f ( x )
1
2
1
h 3 f ( x )
1
3
3
1
h 4 f (4) ( x )
1
4
6
4
1
Table 5.2a. Coefficients of forward finite difference approximations
of
O
( h )
f ( x
4 h )
f ( x
3 h )
f ( x
2 h )
f ( x
h )
f ( x )
hf ( x )
1
1
h 2 f ( x )
1
2
1
h 3 f ( x )
1
3
3
1
h 4 f (4) ( x )
1
4
6
4
1
Table 5.2b. Coefficients of backward finite difference approximations
of
O
( h )
Second Noncentral Finite Difference Approximations
Finite difference approximationsof
( h ) are not popular duetoreasonsthat will be
explained shortly. The commonpractice istouse expressionsof
O
( h 2 ). To obtain
noncentral difference formulasofthisorder, wehavetoretain moreterms in the
Taylor series.As an illustration, we will derive the expression for f ( x ).Westart with
Eqs. (a) and (c), which are
O
h 2
2
h 3
6
h 4
24
hf ( x )
f ( x )
f ( x )
f (4) ( x )
f ( x
+
h )
=
f ( x )
+
+
+
+
+···
4 h 3
3
2 h 4
3
2 hf ( x )
2 h 2 f ( x )
f ( x )
f (4) ( x )
f ( x
+
2 h )
=
f ( x )
+
+
+
+
+···
Search WWH ::




Custom Search