Bisection search 1. In MATLAB, implement a function that performs a bisection search. It should take the...

50.1K

Verified Solution

Question

Advance Math

Bisection search

1. In MATLAB, implement a function that performs a bisectionsearch. It should take the following parameters:

• F: A function (assumed to be continuous) whose roots you wantto find,

• a: A floating-point number giving the left endpoint of theinitial interval in which you want to search for a root of F.

• b: A floating-point number giving the right endpoint of theinitial interval.

• delta: A non-negative floating-point number giving theacceptable proximity of the output to a root of F.

Your function should first check a and b to determine whether ornot they satisfy the condition given by the Intermediate ValueTheorem that allows us to conclude that [a, b] contains a root ofF. If this condition is not satisfied, return NaN (Matlab for “Nota number”). If the condition is satisfied, your function shouldperform a bisection search until it finds a number z that it canguarantee satisfies |x−x∗| < delta, for some real-valued root x∗of F. It should return z.

2. Use the MATLAB function that you wrote to find a real-valuedroot of the function F(x) = x 5 +x+ 1, with accuracy to 4 decimalplaces (this last requirement will determine your choice ofdelta).

3. Suppose that you use bisection search to find a root of F(x)= sin x, with a = −π/2, b = 5π/2. To which root will the bisectionsearch converge?

Answer & Explanation Solved by verified expert
4.2 Ratings (883 Votes)
clc clear all format short fxx5 x 1 function a3b6 interval function c    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students