You are on page 1of 2

UNIVERSITY OF BAHRAIN

Civil Engineering Department

CENG 202 NUMERICAL ANALYSIS

BISECTION METHOD

TUTORIAL 2

Q.1
a. Sketch the graphs of y = ex − 2 and y = cos(ex − 2) together. Observe the intersection of
the curves.
b. Use the Bisection method to find the intersection using an approximation to within
(εs=10−5 ) to a value in [0.5, 1.5] with ex − 2 = cos(ex − 2).

Q.2

A trough of length L has a cross section in the shape of a semicircle with radius r. (See the
figure.) When filled with water to within a distance h of the top, the volume V of water is

V  L[0.5 r 2  r 2 arcsin(h / r )  h(r 2  h2 )1/2 ] .

r
L

Suppose L = 10 m, r = 1 m, and V = 12.4 m3. Find the depth of water in the trough to within εs
=0.01 m.

Q.3

Find an approximation to √3 correct to within εs =10−4 using the Bisection Algorithm. [Hint:
Consider f (x) = x2 − 3.]
MATLAB PROGRAM FOR BI-SECTION METHOD

***********************************************************

xl=1;
xu=2;
es=0.03;
ea=2*es;
i=0;
xr=xl
while ea > es
xro=xr
xr = (xl +xu)/2;
if fb (xl) * fb (xr) < 0
xu = xr;
else
xl = xr;
end
ea=abs((xr-xro)/xr);
i=i+1;
disp([i,ea,xr])
end

*****************************************************************

function [ y ] = fb( x )
y=(x^3) + (x^2) - (3*x) - 3;
end

You might also like