Lahom Laboratory+Activity+1+ +Bisection+Method
Lahom Laboratory+Activity+1+ +Bisection+Method
1
Bisection Method
Name: Section:
Date Performed: Date Submitted:
Instructor:
1. Objective(s):
3. Discussion:
A roots of polynomial function can be determine by the command roots(p) where p is the 1 x n matrix
of coefficients of the polynomial. Bisection method use to find the approximate roots of a given
polynomial function. Approximating the root require a interval [ m, n ], where the root lies between m
and n. Also, the product of m and n is negative or m and n are in opposite sign. The root can be found
by continuous halving m and n until the desired error attained.
m+ n
x=
2
[ 0 7 23 1911 18 14 1 5 226 20 17 13 4 12 3 9 2115 24 16 10 2 8 ]
4. Procedure:
The MATLAB program script for bisection method below, open a new script and encode and run then
save, name the script as bisectionmethod.m
Example 1. Approximate the root of the polynomial in the interval [ 0.1, 0.5 ]
>> sample1
Bisection Method
Iter low high x0
0 0.000000 0.500000 0.250000
1 0.000000 0.250000 0.125000
2 0.125000 0.250000 0.187500
3 0.187500 0.250000 0.218750
4 0.187500 0.218750 0.203125
5 0.187500 0.203125 0.195312
6 0.195312 0.203125 0.199219
7 0.199219 0.203125 0.201172
8 0.199219 0.201172 0.200195
9 0.199219 0.200195 0.199707
10 0.199707 0.200195 0.199951
11 0.199951 0.200195 0.200073
12 0.199951 0.200073 0.200012
13 0.199951 0.200012 0.199982
14 0.199982 0.200012 0.199997
15 0.199997 0.200012 0.200005
x = 0.200005 produces f(x) = -0.000009
15 iterations
Approximation with tolerance = 0.000010
Activity 1
Approximate the root of the polynomial in the interval [ 4.2, 6.3 ]
f(x) = x4 – 5x3 – 7x2 + 41x – 30 , approximate error ≤ 0.00001
Observation: After 17th iteration, the acceptable tolerance is being attained, hence, the root of
the given polynomial is 5.000005 which has a value of f(x) = 0.000476
Activity 2
Approximate the roots of the polynomial in the interval [ – 9.2, – 5.6 ]
f(x) = x5+5x4 – 59x3 – 241x2 + 382x + 560 , approximate error ≤ 0.00001
Observation:After 18th iteration, the acceptable tolerance is being attained, hence, the root of
the given polynomial is -7.999998 which has a value of f(x) = 0.007210.
Exercises
Approximate the root of the following function using bisection method, approximate error ≤ 0.00001
Output
>> x = bisectionmethod(my_fun, low, high,
tolerance);
Bisection Method
Iter low high x0
0 0.000000 1.000000 0.500000 1 0.500000
1.000000 0.750000 2 0.750000 1.000000
0.875000 3 0.875000 1.000000 0.937500 4
0.937500 1.000000 0.968750 5 0.968750
1.000000 0.984375 6 0.984375 1.000000
0.992188 7 0.992188 1.000000 0.996094 8
0.996094 1.000000 0.998047 9 0.998047
1.000000 0.999023 10 0.999023 1.000000
0.999512 11 0.999512 1.000000 0.999756 12
0.999756 1.000000 0.999878 13 0.999878
1.000000 0.999939 14 0.999939 1.000000
0.999969 15 0.999969 1.000000 0.999985 16
0.999985 1.000000 0.999992
x = 0.999992 produces f(x) = -0.001465 16
iterations
Code
Approximation with tolerance = 0.000010
5. (Application)
gm
v= ( 1−e(−c/ m)t )
c
9.81 m
where g= . For a parachutist with a drag coefficient c=15 kg/s , compute the mass m so that
s2
the velocity is v=36 m/s at t=10 s. Use bisection method to determine m in the interval [55 ,60] at
0.000001.
5. Conclusion:
Therefore I believe that by using MATLAB I have easily identified the bisection method for the root/s of
the given polynomial equation. I believe that the use of MATLAB is a great benefit because MATLAB is
really simple to use and open to students. Perhaps this is one of the quickest approaches of bisection.
root/s are found.
Rating =
(Total Score / 21)