Graphics Programs Reference
In-Depth Information
x 3
=
.
x
0
734 87
734 87 3
734 87) 2
f 3
=
0
.
10(0
.
+
5
=−
0
.
00348
The newbrackets on the root are( x 1 ,
x 3 )
=
(0
.
7
,
0
.
734 87).
Second interpolation cycle Applying the interpolationinEq. (4.2) again,weobtain
(skipping the arithmetical details)
x
=−
0
.
000 27
x
=
x 3 +
x
=
0
.
734 87
0
.
000 27
=
0
.
734 60
Again x falls within the latest brackets, so the result is acceptable.Atthisstage, x is
correct to five decimal places.
EXAMPLE 4.5
Compute the zeroof
f ( x )
=
x
|
cos x
| −
1
,
thatlies in the interval(0
4) with Brent's method.
Solution
2.50
2.00
1.50
1.00
f ( x )
0.50
0.00
-0.50
-1.00
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
4.00
x
The plot of f ( x ) showsthatthis is arathernasty functionwithin the specifiedinterval,
containing a slope discontinuity and two local maxima. The sensible approach is
to avoid the potentially troublesome regions of the functionbybracketing the root
astightlyas possible fromavisual inspection of the plot. In thiscase, the interval
( a
,
b )
=
(2
.
0
,
2
.
2) wouldbe agood starting pointforBrent's algorithm.
Search WWH ::




Custom Search