Write a MATLAB function, called Newtons_method that takes as inputs a function, f, it’s…
Write a MATLAB function, called Newtons_method that takes as inputs a function, f, it’s derivative f’, an initial guess 20, an error tolerance, tol, and a maximum number of iterations, N, and outputs the root of f obtained using Newton’s method (denoted by c), starting with 20. Your function should have an error defined by err= |In – In-1), and stop when the error is less than the tolerance, or if the number of iterations exceeds N – whichever happens first. Your function header should look something like:
function [c, n, err] Newtons_method (f, fp, x0, tol,N)
where n is the last iteration when you stop.
Use the function you created to find the root of the equation arctan(x) = 1 with initial guess 10 = 2, to an accuracy of less than tol = 10-8. Did your method converge, and if so, how many iterations did it take? If not, why didn’t it converge, and what happened did it diverge, or end up in an infinite loop? Plot on the same graph the function and the axis y = 0. Test with Xo = -2. What is happening?
Any citation style (APA, MLA, Chicago/Turabian, Harvard)
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.