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
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