Graphics Programs Reference
In-Depth Information
Is Brent's methodrobust enoughtohandle the problemwith the original brackets
(0
,
4)? Well, here is the MATLAB command and its output:
>> brent(@fex4
_
5,0.0,4.0)
ans =
2.0739
The result wasobtainedafter six iterations. The functiondefining
f
(
x
) is
functiony=fex4
5(x)
% Function used in Example 4.5
y = x*abs(cos(x)) - 1.0;
_
4.5
Newton-Raphson Method
The Newton-Raphsonalgorithmis the best-known method of finding roots fora
goodreason: it issimple and fast. The only drawback of the methodisthat it uses
the derivative
f
(
x
) of the functionas well as the function
f
(
x
) itself. Therefore, the
Newton-Raphsonmethodis usable onlyinproblems where
f
(
x
)can be readily com-
puted.
The Newton-Raphson formula can be derived from the Taylor series expansion
of
f
(
x
) about
x
:
f
(
x
i
)(
x
i
+
1
−
x
i
)
2
f
(
x
i
+
1
)
=
f
(
x
i
)
+
x
i
)
+
O
(
x
i
+
1
−
(a)
If
x
i
+
1
is aroot of
f
(
x
)
=
0, Eq. (a) becomes
f
(
x
i
)(
x
i
+
1
−
x
i
)
2
0
=
f
(
x
i
)
+
x
i
)
+
O
(
x
i
+
1
−
(b)
Assuming that
x
i
is a close to
x
i
+
1
, wecan drop the last term in Eq. (b) and solvefor
x
i
+
1
. The result is the Newton-Raphson formula
f
(
x
i
)
f
(
x
i
)
x
i
+
1
=
x
i
−
(4.3)
If
x
denotes the true valueoftheroot, the errorin
x
i
is
E
i
=
x
−
x
i
. It can be shown
that if
x
i
+
1
iscomputed fromEq. (4.3), the corresponding erroris
f
(
x
i
)
2
f
(
x
i
)
E
i
indicating that the Newton-Raphsonmethod converges
quadratically
(the erroris the
square of the errorinthe previous step).As a consequence, the number of significant
figures is roughlydoubledinevery iteration, provided that
x
i
is close to the root.
E
i
+
1
=−
Search WWH ::
Custom Search