Lecture 7.
Secant
Method
The Secant method is
a variant of Newton's method does not use derivatives. The behaviour of the
secant method is very similar to Newton's method, that it, it usually has a good
rate of convergence, but sometimes it can fail.
Hybrid
Method(s)
The idea of hybrid root
finding methods is to maintain a pair of values that brackets a zero. An
iteration compares the result of some fast converging algorithm (for example the
secant method or inverse quadratic interpolation) to the bracketing pair. If the
value is bracketed then it's kept, otherwise we use a step of the Bisection
algorithm. (Note: A sharp eyed classmate pointed out that the algorithm I wrote
on the board should be "if x is not bracketed x = value of a bisection
step.)
Explorations
with Matlab
We looked at some
Matlab functions today. Some of the functions I wrote (e.g. bisectDR), and
others are from Recktenwald (e.g. bisect) and still others are from the Matlab
toolbox (e.g. fzero).
Here is the
Matlab function m-file that I wrote to plot a guitar's
fretboard.
function
fretboard(r);
% fretboard
draws a fret board of length 10 where the ith fret is
% placed at a distance of 10/r^i
from the nut which is on the right.
%
% Synopsis:
fretboard(r)
%
%
Input: r = the ratio beween consecutive frets
% For equal tempered tuning the
value of r should
% be an
approximation so that r^12 =
2.
%Draw fretboard from
nut to bridge as a box.
hold on
% Allow overlaying of plots onto the same graphics
window.
% Draw the outline of
the guitar neck
BX =
[0,0,10,10,0];
BY =
[0,1,1,0,0];
plot(BX,BY)
%plot
22
frets
fx=10;
for
i = 1:22
fx = (fx / r
);
plot([fx,fx],[0,1])
end
%
Set the axis equal so that we get a long and narrow
fretboard
axis
equal
Posted: Mon - September 25, 2006 at 03:20 PM