Goal:
To understand Fixed Point iteration, its purpose, how it works, and why/when it works, by
experimenting in the Fixed Point iteration lab, and by writing your own Fixed Point
iteration code. Also to reflect on possible differences and the relative merits
of Fixed Point iteration and Bisection, respectively.
Program:
1. Start matlab and run the matlab script setMatlabPath, which makes certain additions
to your matlab search path.
2. Give the command open('RMplus.fig') to open the Road Map to the Mathematics
Laboratory, and press the Fixed P iter button to enter the Fixed Point iteration lab.
Alternatively you may enter this lab directly from the matlab prompt by the
command open('FIXEDP.fig').
3. Use the Fixed Point iteration lab as follows:
Give g(x), and a "return" to plot its graph (or choose one from the menu).
Note that also the "diagonal" y=x is plotted.
Look for an x such that g(x)=x, that is an intersection of the graphs y=g(x) and y=x,
and give a nearby x-value in the x= box below the plot window, followed
by a "return" to have the corresponding g(x) value computed and displayed (on the y-axis
but also on the x-axis, for conveniant comparison with the given x-value. Recall
that we seek an x such that g(x)=x).
Next put the value of g(x) into the x-box, that is redefine x as g(x) by putting
x=g(x), manually (folled by a return or simpler by pressing the iterate button.
Repeat!
You may also automize the iteration process by giving a certain number of iterations, or
a certain tolerance (and a return in the corresponding edit box).
4. As a first couple of examples, solve
a) 0.3+0.3x=x b) 0.6-0.3x=x c) 1/(1+x^2)=x (you have to write ./ and .^ in the last example)
Try starting from both sides of the solution, say from x=0 and x=1, respectively.
5. Then try solving the equation 1-x^3=x. If necessary, rewrite the equation, for example
as (1-x^3+kx)/(k+1)=x (obtain by adding kx to both sides and dividing by k+1), here
with k=1 or k=2, say.
6. Find both roots of the equation x^2+2x-1=x.
7. Solve a) 2-x^3=0
b) x^2-3=0. Hint: Add kx to both sides and divide by k.
8. Compare the number of iterations required to reach the root x=0 for the equations
a) x/2=x and b) x^2=x, starting at x=0.4, say.
9. Pose further questions of your own and experiment!!
10. Now make your own g(x)=x solver by implementating the Fixed Point algorithm (for example)
according to the specification in Fixed Point iteration code .
/kenneth