Fixed-point Methods last
We would like to experimentally verify these results.
Problem: The method only returns the final result, not the whole sequence.
We need to modify it so it will return all the \(p_n\)’s.
There is some code on page 85, but it has number of issues.
This is supposed to track convergence.
Why is it called fixedpt2?
list should not be global!
Use push! rahter than append!!
Where is eps even used?
Why is “error” handled this way? It is not even an error!
What if we want to analyze nonlinear convergence?
Only works if the fixed point is \(\sqrt{2}\)!
Solve \(x^2 - 3 = 0\).
We need to turn it into the form \(g(x) = x\).
One option: Newton’s method
How about \(x + x^2 - 3 = x\)?
Why not \(x - (x^2 - 3) = x\)?
Try this: \(x - \frac{1}{2}(x^2 - 3) = x\).
Approximate the solution of \(x^3 - 2x^2 - 1 = 0\) on \([1,3]\)
\(f(x) = x^2 - 2x^2 - 1\)
Try \(g(x) = x - f(x)\).
Try \(g(x) = x - cf(x)\) for some \(c\).
Rewrite the equation:
\(x^3 = 2x^2 + 1\), or \(x = (2x^2 + 1)^{1/3}\).