Question: Problem 1 : A Hybrid Bracketing Method A new method tor solving a nonlinear equation f ( x ) = 0 is proposed in this

Problem 1: A Hybrid Bracketing Method
A new method tor solving a nonlinear equation f(x)=0 is proposed in this problem. The method is a
combination of the bisection and the false position methods. The solution starts by defining an interval
a,b that brackets the solution. Then estimated numerical solutions are determined once with the bisection
method and once with the false position method. (The first iteration uses the bisection method.) Write a
MATLAB user-defined function that solves a nonlinear equation f(x)=0 with this new method. Name
the function x= BiFalRoot (Fun, a, b, Tol), where the output argument x is the solution. The input
argument Fun is a name for the function that calculates f(x) for a given x(it is a dummy name for the
function that is imported into BiFalRoot), a and b are two initial points that bracket the root, and Tol is
the error tolerance.
Your code should include the following features:
The program should stop when the estimated relative error drops below the specified tolerance Tol.
Check if points a and b are on opposite sides of the solution. If not, the program should halt and
display an error message of your choice.
The number of iterations should be limited to 100(to avoid an infinite loop). If a solution with the
required accuracy is not obtained in 100 iterations, the program should stop and display an error
message of your choice.
Use the function BiFalRoot to solve the equation cos(x)-0.8x2=0 with a=0 and b=2 and observe the
answer. For Tol use 0.00001.
Problem 1 : A Hybrid Bracketing Method A new

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 Programming Questions!