Bisecstional Method
Bisecstional Method
Objectives:
1. To determine roots of an equation in single variable using Bisection method.
2. To understand the Python implementation of the Bisection method.
3. To analyze of results using different initial values and error tolerance.
4. To compare the two mention methods and pick the better one.
Introduction:
Bisection Method:
The bisection method is a simple and convergence method used to get the real roots of non-linear
equations. The Bisection method repeatedly bisects or separates the interval and selects a subinterval
in which the root of the given equation is found. It is a very simple and robust method but slower
than other methods. Bisection Method calculates the root by first calculating the midpoint of the
given interval end points.
It is also called Interval halving, binary search method and dichotomy method.
It means if a function f(x) is continuous in the closed interval [a, b] and the f(a) and f(b) are two real
numbers of opposite signs that contain at least one real root of f(x) = 0, between a and b. This
method is also known as the Bolzano or Half Interval or Binary search method.
ALGORITHM:
1. Define the function f(x) that you want to find the root for.
2. Choose an interval [x1, x2] such that f(x1) * f(x2) < 0 (i.e., the function values have opposite
signs at the endpoints).
3. Set a tolerance value to control the precision of the result.
4. Calculate f(x1) and f(x2). If either f(x1) or f(x2) is size zero, then you’ve found a root, and
the algorithm terminates.
5. If f(x1) * f(x2) > 0, print “Root not found” since the bisection method requires that the
function values have opposite signs at the endpoints.
6. Calculate the number of iterations needed, n, based on the formula.
7. Iterate n times (or until convergence) using the steps. Here will be four steps.
8. After the loop, return the approximate root.
9. If the loop completes without finding a root, print “Root not found.”
Equation: x 3−x−1=0❑
❑
❑
❑
❑
3 ❑
x -❑/❑❑
Implementation code:
Output:
Result = 1.25
Conclusion: Bisection is the basic and important method of finding the solution of non-linear
equations. In mathematics, the bisection method is a root- finding method that applies to continuous
Function for which knows two values with opposite signs.
The experiment was done successfully on the lab with the help of Python. The Codes were worked
perfectly during the experiment. But some of the problems were faced during the experiment as the
codes were not written on Python. But facing all the problems, the experimental study of bisection
method was done successfully.