Question: use matlab program for coding and add comments to explain what is the code doing every few lines. thank you. Write a computer code to

 use matlab program for coding and add comments to explain what

use matlab program for coding and add comments to explain what is the code doing every few lines. thank you.

Write a computer code to find all the roots of the function between 0.01 and 50.01 Step 1: First subdivide the interval and do an Incremental Search. Use an interval of 0.01 to 50.01 for the Incremental Search. Then, your code should be able to find the sign changes and pick the upper and lower bounds of each root, before starting the following methods to find each root within the interval. Step 2: Use the bounds from the incremental search where you know there is a root to start the Bisection method. Step 3: Once the approximate error for the Bisection method falls below 10%, switch to the Secant method and continue to iterate until you have found each root with an accuracy of 6 significant figures. To start Secant, use your last two bounds on Bisection as the first two guesses for Secant making the lower bound x-1 and the upper bound as xi. After the first iteration, proceed as normal with secant. f(x)In(0.09x cos(0.2x) a) How many roots did you find? b) What were the roots? c Have your code keep track of the number of function evaluations. In other words, each time you evaluate the function above at a givenx-value, count that as a function evaluation and keep track of the total count of function evaluations. Make sure to count all of the function evaluations equally, whether they were for the incremental search, the bisection method, or secant method. Now vary the step size of the incremental search starting as follows. First use 0.01, then 0.1, then 0.5, then 1, then 2, then 5, then 10. How many total function evaluations did each step size take? Populate the following table: Incremental Search Step Size 0.01 0.1 0.5 Total Number of Function Evaluations 10 Explain your results, keeping in mind that the goal of coding would always be to minimize the number of function evaluations, because function evaluations take time and can contribute to round-off error, d) Using an incremental search step size of 10, how many total iterations (Bisection plus Secant) did each root take

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!