Question: In MATLAB Please Problem 2: Newton-Raphson method One numerical method for calculating the root of an equation is called Newton-Raphson method. The solution process starts
In MATLAB Please

Problem 2: Newton-Raphson method One numerical method for calculating the root of an equation is called Newton-Raphson method. The solution process starts by choosing a value X as a first estimate of the solution. Using this value, a second, more accurate solution x2 can be calculated with x2 = x1 - f(x1) which is then f'(x2) used for calculating a third, still more accurate solution x3, and so on. The general equation for the algorithm to estimate the solution of a nonlinear equation is thus: f(xk) Xk+1 = xk f'(xx) a) Develop a MATLAB user-defined function (numerical solver) that solves for a root of an equation f(x) = 0 using the Newton's method. For the function name and arguments use function [x, er, N]=Newtonroot(fun, funder,x1, maxtol, maxitr) The input argument fun is a name for the function that calculates f(x) for a given x, funder is the function that calculates the derivative of f(x), x1 is the initial estimate of the solution, maxtol is the maximum tolerance and maxitr is the maximum number of iterations. The output argument x is the approximate value of the root, er is the relative approximate error, and N is the number of iterations that are performed to obtain the solution. The program will stop if either of the following conditions is met: The approximate error is less than the maximum tolerance (maxtol). The number of iterations exceeds the maximum number of iterations (maxitr) [Modify the inputs of the fixed-point code, and in the iteration loop, change one line to implement the Newton-Raphson algorithm. All the basic structures are similar!] Optional: using fprintf, output these values at each iteration: k 3 x, fun(x), er
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
