Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this programming exercise we will use PYTHON to implement the root finding algorithms taught in class. Write a PYTHON program to implement the false
In this programming exercise we will use PYTHON to implement the root finding algorithms taught in class.
Write a PYTHON program to implement the false position method to find the roots of equation
accurate up to four significant digits.
a First, define a PYTHON function in the following manner:
def falseposfunc a b es:
where func represents the bracket and is the stopping criteria. Thereafter, call this function
for different brackets to find the roots. Report their values.
b Make a plot of vs and identify these roots via markers.
c Verify your solutions using the inbuilt PYTHON function brentq for Brent's method. Note that you need
to import scipy to access this function.
Now write a PYTHON function to implement the secant method:
def falseposfunc x es:
where are the two starting points.
a Use the function to find roots of accurate up to significant digits. Report
their values.
b Again make a plot of the above function to and mark all the roots.
c Verify your solutions using the inbuilt PYTHON function roots, which is available in numpy.
Utilizing the above functions, find the shortest distance between the curve and the point
Report the shortest distance. Which method converges faster, the false position or the secant method? report
the number of iterations in both cases
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started