Information Technology Reference
In-Depth Information
Algorithm 4.3
Secant Method.
Given two initial approximations x 0 and x 1 of x , and a tolerance " .
k D 1
while j f.x k / j >" do
x kC1
.x k x k1 /
f.x k / f.x k1 /
D x k f.x k /
k D k C 1
end
Example 4.3. Let us now repeat the computations that were used to test the behavior
of the secant method. First we consider
f.x/ D 2 C x e x
(4.68)
and we use x 0 D 0, x 1 D 3 and " D 10 6 .InTable 4.3 we show the number of
iterations k, x k ,andf.x k / as computed by Algorithm 4.3 . Note that convergence
is somewhat slower than that of Newton's method (cf. Table 4.2 on page 109 ), but it
is faster than the bisection method (cf. Table 4.1 on page 105 ).
Example 4.4. Let
f.x/ D x 2 2:
(4.69)
Our aim is to compute approximations of x satisfying
f.x / D 0;
(4.70)
Solving the nonlinear equation f.x/ D 2 C x e x
Tabl e 4. 3
D 0 by Algorithm 4.3 : the number
of iterations k, x k ,andf.x k /
k
x k
f.x k /
2
0:186503
0:981475
3
0:358369
0:927375
4
3:304511
21:930701
5
0:477897
0:865218
6
0:585181
0:789865
7
1:709760
1:817874
8
0:925808
0:401902
9
1:067746
0:158930
10 2
10
1:160589
3:122466
10 3
11
1:145344
1:821544
10 5
12
1:146184
1:912908
10 8
13
1:146193
1:191170
 
Search WWH ::




Custom Search