The Secant Method
The Newton-Raphson algorithm requires two functions evaluations per
iteration,
and.Historically,
the calculation of a derivative could involve considerable effort.But, with
modern computer algebra software packages such as Mathematica, this has
become less of an issue.Moreover, many functions have non-elementary forms
(integrals, sums, discrete solution to an I.V.P.), and it is desirable to have a
method for finding a root that does not depend on the computation of a
derivative. The secant method does not need a formula for the derivative and it
can be coded so that only one new function evaluation is required per
iteration.
The formula for the secant method is the same one that was used in the
regula falsi method, except that the logical decisions regarding how to define
each succeeding term are different.
Theorem (Secant Method).
Assume that
and there exists a number
,
where
.If,
then there exists a
such that the sequence
defined by the iteration
for
will converge to
for certain initial approximations.
Algorithm ( Secant Method ).Find
a root ofgiven
two initial approximationsusing
the iteration
for.
Mathematica Subroutine (Secant Method).
Example.Use the secant method to find
the three roots of the cubic polynomial.
Determine the secant iteration formulathat
is used.
Show details of the computations for the starting value.
Solution.
Reduce the volume of printout.
After you have debugged you program and it is working properly,
delete the unnecessary print statements
and
and
Concise Program for the
Secant Method
Now test this subroutine using the function in Example 1.
Error Checking in the
Secant Method
Error checking can be added to the secant method.Here we have added a third
parameterto
the subroutine which estimate the accuracy of the numerical solution.
The following subroutine call uses a maximum of 20 iterations, just to make
sure enough iterations are performed.
However, it will terminate when the difference between consecutive iterations is
less than.
By interrogatingkafterward we can see how many iterations were actually
performed.
Various
Scenarios and Animations for the
Secant Method.
|