Question: I am taking an online Python class. I am stuck on this assignment. Please advise. Write a secant method program to solve the equation I

I am taking an online Python class. I am stuck on this assignment. Please advise.

I am taking an online Python class. I am stuck on this

Write a secant method program to solve the equation I sin kr-I=C To complete this assignment you will need to successfully implement each of the three methods. Have each of your methods functions display (i.e.print) the following for each iteration: .Iteration number Estimated root (the newest x value) The function value at the estimated root Relative Emor With the above inputs, the secant method should return the root with an error less than le-6 in 7 iterations. Seek help early from me, tutors, or your classmates if your method is not behaving properly To write your secant program, do the following: 1. In a file called secant .py, define a secant function (named secant) that takes four parameters: first, the name of the equation function to solve (call it f): second, the lower bound root estimate x1, and third, the upper bound root estimate x2, and forth, the maximum error acceptable in the solution errorMax. Set a default value of le-6 for errorMax. The secant function should return the root estimate. 2. At each iteration, the secant function should: (a) Calculate the new root estimate 1+1 1+1=2,- fr) (-1-.) -1)-14) (b) Calculate the approximate error for this root estimate from the most recent two root estimates (c) Print the iteration number, the new root estimate, and the error 3. Test your secant code by finding the root of Equation 1 above, with k = 10 C as well as = 2.2 and 2.7. are given as the initial root estimates 1.If r=0.6 and 1.2. over the interval (0, 3). Identify on the plot the two roots found with the 4. Make a plot of Equation inputs above. Write a secant method program to solve the equation I sin kr-I=C To complete this assignment you will need to successfully implement each of the three methods. Have each of your methods functions display (i.e.print) the following for each iteration: .Iteration number Estimated root (the newest x value) The function value at the estimated root Relative Emor With the above inputs, the secant method should return the root with an error less than le-6 in 7 iterations. Seek help early from me, tutors, or your classmates if your method is not behaving properly To write your secant program, do the following: 1. In a file called secant .py, define a secant function (named secant) that takes four parameters: first, the name of the equation function to solve (call it f): second, the lower bound root estimate x1, and third, the upper bound root estimate x2, and forth, the maximum error acceptable in the solution errorMax. Set a default value of le-6 for errorMax. The secant function should return the root estimate. 2. At each iteration, the secant function should: (a) Calculate the new root estimate 1+1 1+1=2,- fr) (-1-.) -1)-14) (b) Calculate the approximate error for this root estimate from the most recent two root estimates (c) Print the iteration number, the new root estimate, and the error 3. Test your secant code by finding the root of Equation 1 above, with k = 10 C as well as = 2.2 and 2.7. are given as the initial root estimates 1.If r=0.6 and 1.2. over the interval (0, 3). Identify on the plot the two roots found with the 4. Make a plot of Equation inputs above

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!