Question: MATLAB code Write your own program that performs fixed point iteration for a given function g(x). Check whether your program converges to a fixed point
MATLAB code
Write your own program that performs fixed point iteration for a given function g(x). Check whether your program converges to a fixed point or if it diverges. The convergence criterion for your program is given by the condition |xn+1 xn| < tol, where tol is a given tolerance. When it diverges, your code should run up to a maximum number N of iterations or implement a line to stop the code. Print out a message in either case to say how many steps your program has run, and what solution it has found (if the method converges). Use your program to solve the the following question
1-check that 0 and r 1 are roots of f(x) = x^2 (r 1)x = 0. Define g(x) = rx x^ 2 . Which of the roots will be found by the Fixed-Point Iterations for r = 0.9 and r = 2.8 if your initial guess is close enough to the fixed point (try different initial values but not the roots)? Carefully choose your initial x0, a tolerance of 10^6 , and a maximum number of steps N = 200.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
