Question: a Problem 6 (MATLAB) Newton-Raphson and Secant method. Write a Show Secant script file and Show Newton Raphson script file that illustrate the secant and

a Problem 6 (MATLAB) Newton-Raphson and Secant method. Write a Show Secant script file and Show Newton Raphson script file that illustrate the secant and Newton Raphson method framework. Consider the function, f(x) = (2 x)e- -0.5x + 0.05x 1 = (i) Write a MATLAB program to obtain the root of f(x) using Newton-Raphson method with the following three initial guesses, (a) Xo = 1, (b) Xo = 4, and (c) Xo 7. Calculate the approximate percent error at each iteration. How many iterations are needed for the approximate error to go below 0.001%? Discuss the results. = = = - 0 and xo (ii) Write a MATLAB program to obtain the root of f(x) using Secant method with initial guesses of x-1 2. Calculate the approximate error at each iteration. How many iterations are needed for the approximate error to go below 0.001%? (iii) Plot the error with the iteration number for both parts (i) and (ii) in the same graph and comment. Hint: Plot the graph of f(x) to have a better understanding of the behavior of the solutions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
