Question: How to solve it using Python code 5. (5 points) Write a function called newton which takes input parameters f, To, h (with default value

 How to solve it using Python code 5. (5 points) Write

How to solve it using Python code

5. (5 points) Write a function called newton which takes input parameters f, To, h (with default value 0.001), tolerance (with default value 0.001) and max_iter (with default value 100). The function implements Newton's method to approximate a solution of f(z)-0. In other words, compute the values of the recursive sequence starting at To and defined by Use the central difference formula with step size h to approximate the derivative f(). The desired result is that the method converges to an approximate root of f(r) however there are (a) The sequence reaches the desired tolerance f()tolerance and newton returns the (b) The number of iterations exceeds the maximum number of iterations max_iter, the (c) A zero derivative is computed f'(Fn) = 0, the function prints the statement "Zero several possibilities: value n function prints the statement "Maximum iterations exceeded." and returns None derivative." and returns None

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!