Question: Using the pseudocodes provided in lecture, write functions that implement the false position ( FP ) and secant methods to find the roots of single
Using the pseudocodes provided in lecture, write functions that implement the false position FP and secant methods to find the roots of single equations.
Then use them! Find the first positive roots of the following two equations:
For both equations, use the interval for FP and the starting point for Secant. Does the single starting point provide a positive root for secant in each case? If not, explain why and try the starting point
Provide the number of iterations performed to reach a root in all four cases each equation, each method Comment on the counts required for each method.
Automated Bounds Finding
Using the pseudocode provided, write a wrapper for FP that, when given the single starting point will find bounds for FP then find the root of using that method. Provide the number of iterative steps to find the bounds ie how many times you "adjusted" a andor b before you bounded the root and what the bounds provided to FP were.
NOTE! Some of the guesses WILL give you negative roots or diverge! This is intentional. As I write above, "describe what happens for each starting guess".
Multiple Root Problems
Use the MATLAB function fsolve to solve the dimensional root problem
The steps for this are:
Develop a "zeros" function for the two equations as shown in the example problem for fsolve. Note that you will have to use a single vector to pass and that is rename these as
Use an initial guess of
Call fsolve with a handle to the function you created and the initial guess.
Note that you can fairly easily get an idea where the true roots are by graphing the functions.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
