Question: 3. Devise and implement in MATLAB fixed-point iterative methods for the solution of the nonlinear equation 1 log(x) - = 0 x-1 (*). (a) Produce

3. Devise and implement in MATLAB fixed-point iterative methods for the solution of the nonlinear equation 1 log(x) - = 0 x-1 (*). (a) Produce a figure to illustrate that this equation has two positive roots in the interval (0,3). Use red circle markers to locate the roots on the figure. (7 marks) (b) Create a MATLAB function myFixedPoint(9, x0, tol, maxiter) implementing a fixed iteration of the type xn+1 = g(xn). The MATLAB function should take as arguments the mathematical function to be iterated g, the initial guess xo, the required tolerance tol and a parameter specifying the maximum number of iterations allowed. The function should return a list [xn, errn] of two lists containing all values of the iterates {Xn, n = 0, ...} and the error measured {en = \Xn - Xn-11, n = 0,... }, respectively, computed at 3/4 SIM1004 each iteration step. In the loop, display the number of iteration, the xn and the error measured, and make sure to produce the output in the following format, Iteration 1 2 x(n) 2.50000 |x(n+1) - x(n) Inf : where both Xn and Xn+1 - Xn are diplayed up to 5 and 7 decimal digits, respectively. You are not allowed to use MATLAB function fzero to solve this problem. (13 marks) (c) Provide comments in the above MATLAB function to describe what each line does
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
