Question: Bisection Method Write a MATLAB function that implements the bisection algorithm for obtaining the roots of a given function f(x). Use this function to find

Bisection Method

Write a MATLAB function that implements the bisection algorithm for obtaining the roots of a given function f(x). Use this function to find the smallest positive root of the equation f(x) = 0 where

f(x) = tan(pi*x) - x - 6

Plot f(x). By visual observation of the appropriate plot, explain why the interval [0.4,0.48] is a

good choice for the first bracketing interval in the iterative procedure of the bisection method.

Given your initial interval, first write out explicitly on paper all detail describing your first iteration. Indicate how you choose the bracketing interval for the 2nd iteration and estimate your approximate relative error.

Run your program and have it list the number of iteration, values of the endpoints and the midpoint (xl(k), xu(k), and xr(k)) in the notation used in the textbook), the estimated approximate

relative error, and the value of f(xr(k) for each iteration k. List those values from the second iteration onward. Run until your approximate relative error drops below a tolerance of 10-5 (*) .

How many function evaluations did you have to perform to reach this particular tolerance ? NOTE: The actual code to solve this problem can be found very easily ! Dont reinvent the wheel !

(*) This is NOT a percent relative error.

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!