Question
Create a function to determine the left-most root of the following equation using the Bisection Method: f(x)=x2+10 The input would be in the sequence, a,
Create a function to determine the left-most root of the following equation using the Bisection Method:
f(x)=x2+10
The input would be in the sequence, a, b, and error. Name the function "bisection_method(a, b, error)". The "a" is the lower bound, the "b" is the upper bound, and the "error" is the tolerance level. If there is no root then the display would be "no root".
Note: Do not call the function at the end of the script. The function should only output one value; suppress all other outputs.
The code should have this:
Test
a = 0;
b = 5;
error = 0.01;
disp(bisection_method(a,b,error))
expected answer = 3.1543
test
a = -5;
b = 0;
error = 0.01;
disp(bisection_method(a,b,error))
expected answer = -3.1543
test
a = 0;
b = 5;
error = 0.0001;
disp(bisection_method(a,b,error))
expected answer = 3.16231
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