Practice 1 Name: Implementing Bisection Method Using Excel.: 1. Objective: 2. Equipment: 3. Background
Practice 1 Name: Implementing Bisection Method Using Excel.: 1. Objective: 2. Equipment: 3. Background
We know, by the Intermediate Value Theorem, that since f is continuous, and since
f(0) < 0 and f(1) > 0, f must have a root between 0 and 1. Thus the root lies between
[0,1]. To find this using the Bisection method, we will want to use the IF function in
Excel. = IF(logical_test, value_if_true, value_if_false) takes < value_if_true > if the <
logical_test > is true, and takes < value_if_false > if the < logical_test > is false.
Here’s how I used this in the spreadsheet show in figure 2 below.
This method can be better understood by looking at a graph of the function show in
figure 1 below.
Figure1. graph of the function 𝒇(𝒙) = √𝒙 − 𝐜𝐨𝐬(𝒙)
Where:
Iteration = Number of actual iteration F(xa) evaluate function with (xa) value
Xa= initial value of lower interval F(xb) evaluate function wiht (xb) value
Xb= final value of Upper interval F(xr) evaluate function wiht (xr) value
xr = midpoint between xa and xb i.e xa + xb /2 F(xa)*f(xr) multiply values of f(xa) *f(xr)
Error = abs((xr2-xr1)/xr2)*100 Ending =si(error<1,then “finish” else “continued”
This works because if f(xr)*f(xa) is positive, then you want to keep the old xb and
replace the old xa with xr. On the other hand, if f(xr)*f(xa) is negative, then you
replace the old xb with xr, and keep the old xa. (In the unlikely event that f(xr) = 0,
this particular spreadsheet malfunctions slightly.
5. Discussion
1. by using Excel spreadsheet software program, find the root of √80 use Bisection
method.
2. Use excel spreadsheet software program to find the roots of the following equation
using bisection method:
a. x2 − 11x + 10 = 0 b. f(x) = 2ex − 2x – 3 c. 3x3 + 3x2 − 3x – 1= 0
Homework complete the rest of procedure
Calling Sequence
Examples
restart;
with(Student[NumericalAnalysis]): # library that contained the function
F=x^3−7*x^2+14*x−6:
plot(F, x=-3..3);
Sol :=Bisection(f, x=[2.7,3.2],tolerance=10−2)
Sol:= 2.996875000
Bisection(f,x=[2.7,3.2],tolerance=10−2,output=sequence)
[2.7,3.2],[2.950000000,3.2],[2.950000000,3.075000000],[2.950000000,3.012500000]
,[2.981250000,3.012500000],2.996875000
Bisection(f,x=[2.7,3.2],tolerance=10−2,stoppingcriterion=absolute)
3.004687500
> Bisection(f,x=[3.2,4.0],output=animation,tolerance=10−3,stoppingcriterion=function_va
lue)
> Bisection(f,x=[2.95,3.05],output=plot,tolerance=10−3,maxiterations=10,stoppingcriterio
n=relative)