Graphics Programs Reference
In-Depth Information
EXAMPLE 5.1
Given the evenly spaceddatapoints
x
0
0
.
1
0
.
2
0
.
3
0
.
4
f ( x )
0
.
0000
0
.
0819
0
.
1341
0
.
1646
0
.
1797
compute f ( x ) and f ( x ) at x
=
0 and 0
.
2using finite difference approximationsof
O
( h 2 ).
Solution From the forward difference formulas in Table 5.3a we get
3 f (0)
+
4 f (0
.
1)
f (0
.
2)
3(0)
+
4(0
.
0819)
0
.
1341
f (0)
=
=
=
.
0
967
2(0
.
1)
0
.
2
2 f (0)
5 f (0
.
1)
+
4 f (0
.
2)
f (0
.
3)
f (0)
=
(0
.
1) 2
2(0)
5(0
.
0819)
+
4(0
.
1341)
0
.
1646
=
=−
3
.
77
(0
.
1) 2
The central difference approximations in Table 5.1 yield
f (0
.
1)
+
f (0
.
3)
0
.
0819
+
0
.
1646
f (0
.
=
=
=
.
2)
0
4135
2(0
.
1)
0
.
2
f (0
.
1)
2 f (0
.
2)
+
f (0
.
3)
0
.
0819
2(0
.
1341)
+
0
.
1646
f (0
.
2)
=
=
=−
2
.
17
(0
.
1) 2
(0
.
1) 2
EXAMPLE 5.2
Use the data in Example 5.1 to compute f (0) as accuratelyas you can.
Solution One solutionistoapplyRichardson extrapolation to finite difference ap-
proximations.Westart with twoforward difference approximationsfor f (0): one
using h
1. Referring to the formulasof O ( h 2 ) in
=
0
.
2 and the other one using h
=
0
.
Table 5.3a, we get
3 f (0)
+
4 f (0
.
2)
f (0
.
4)
3(0)
+
4(0
.
1341)
0
.
1797
g (0
.
2)
=
=
=
0
.
8918
.
.
2(0
2)
0
4
3 f (0)
+
4 f (0
.
1)
f (0
.
2)
3(0)
+
4(0
.
0819)
0
.
1341
g (0
.
1)
=
=
=
0
.
9675
2(0
.
1)
0
.
2
where g denotes the finite difference approximation of f (0).Recalling that the error
in both approximations is of the form E ( h )
=
c 1 h 2
+
c 2 h 4
+
c 3 h 6
+··· ,
wecan use
Richardson extrapolation to eliminate the dominanterror term. With p
=
2weobtain
Search WWH ::




Custom Search