Question: Using MATLAB... (30) The bisection search is a simple algorithm to find a root of a continuous function f(x) (i.e., a value of x such

Using MATLAB...Using MATLAB... (30) The bisection search is a simple algorithm to find

(30) The bisection search is a simple algorithm to find a root of a continuous function f(x) (i.e., a value of x such that f(x) = 0) when one knows that a root must lie within some range. The idea is that f(a) 0, then there must be an x between a and b for which f(x) 0. One guesses that the answer is at the midpoint (a+b) / 2 and checks that point. If the f((a+b)/2) 0, then the root must be between a and (a+b)/2, and we can repeat the process using b = (a+b)/2, we will write three different versions of the bisection search to practice functions. 5. [TUES] The function f(x) c1* sin(Tx) + c2*cos(nx) must have a root between 0 and 1. Write a function that takes as input three values - c1, c2, and tol - and returns as output the value of x for which c1*sin(Tx) + c2*cos(nx) = 0. The routine should use a while loop and should return (a+b)/2 when (b-a)tol. Test your code using c1 2, c2 1 and tol 105. The answer should be 0.8524. a. b. [THURS] Write a function that takes as input a function handle, a, b, and tol, and gives as a single output the value of x, between a and b, for which the function returns zero. Again use a stopping criteria that (b-a) 0, then there must be an x between a and b for which f(x) 0. One guesses that the answer is at the midpoint (a+b) / 2 and checks that point. If the f((a+b)/2) 0, then the root must be between a and (a+b)/2, and we can repeat the process using b = (a+b)/2, we will write three different versions of the bisection search to practice functions. 5. [TUES] The function f(x) c1* sin(Tx) + c2*cos(nx) must have a root between 0 and 1. Write a function that takes as input three values - c1, c2, and tol - and returns as output the value of x for which c1*sin(Tx) + c2*cos(nx) = 0. The routine should use a while loop and should return (a+b)/2 when (b-a)tol. Test your code using c1 2, c2 1 and tol 105. The answer should be 0.8524. a. b. [THURS] Write a function that takes as input a function handle, a, b, and tol, and gives as a single output the value of x, between a and b, for which the function returns zero. Again use a stopping criteria that (b-a)

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!