Question: Implement the Secant method. You will be given a scalar function f whose root is to be sought. The first two starting points, [X1 ,
Implement the Secant method. You will be given a scalar function f whose root is to be sought. The first two starting points, [X1 , X2] will be stored in a numpy array xks and will be given to you. You will need to perform 5 iterations of secant method. In each teration, please save the root you find in roots. Return the roots array which should have five elements The follwing information is available to you: f : The function whose root you are looking for. The initial two guesses of the roots. xks OUTPUT . roots The five roots you have found by the Secant method. Hint: The Secant method uses a linear interpolation of the most recently found roots to approximate the derivative term in the Newton's method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
