A
REPORT ON
BISECTION METHOD USING VBA AND EXCEL
FUNCTIONING
PREPARED BY: BIMAL POUDEL
Introduction
The bisection method is one of the most fundamental numerical techniques used to
find the roots of a continuous real-valued function. It is based on the Intermediate
Value Theorem (IVT), which guarantees that if a function f is continuous on a closed
interval [a,b] and f(a) and f(b) have opposite signs, then there exists at least one root c
in (a,b) such that f(c)=0. Unlike open methods such as the Newton-Raphson or Secant
method, the bisection method is a bracketing method, meaning it requires two initial
guesses that enclose the root. The method systematically narrows down the interval
by repeatedly halving it and selecting the subinterval in which the root must lie.
History of the Bisection Method
The bisection method dates back to ancient mathematics, where early mathematicians
used interval halving to approximate solutions.
It was formally described in the 19th century with the development of rigorous
numerical analysis. Due to its simplicity and guaranteed convergence, it remains a
fundamental technique in numerical computing.
Mathematical Foundation
The bisection method relies on the following key principles:
1. Intermediate Value Theorem (IVT):
i) If f is continuous on [a,b] and f(a) f(b)<0, then ∃c∈(a,b) such that f(c)=0.
ii) This theorem ensures that a root exists within the interval, provided the function
crosses zero.
2. Iterative Halving Process:
i) The algorithm computes the midpoint c = a+b/2
ii) It then checks the sign of f(c):
a) If f(c)=0, then c is the exact root.
b) If f(a) f(c)<0, the root lies in [a,c], so b is updated to c.
c) Otherwise, the root lies in [c,b], so a is updated to c.
iii) This process repeats until the interval width |b−a| is smaller than a predefined
tolerance ϵ.
Convergence Analysis
The bisection method guarantees linear convergence, meaning the error decreases by
approximately half in each iteration.
ì) Error Bound:
After n iterations, the size of the interval is:
|bn-an| = |bo-ao|/2^n
The absolute error is bounded by:
|cn-c| ≤ |b-a|/2^n+1
where cn is the approximate root at the n-th iteration and c is the true root.
ii) Stopping Criteria:
The algorithm terminates when:
|b−a|<ϵ or |f(c)|<δ
Advantages of the Bisection Method
1. Guaranteed Convergence: Unlike Newton’s method, which may diverge, the
bisection method always
converges if the initial interval satisfies f(a) f(b)<0.
2. No Need for Derivatives: The method does not require the computation of f'(x),
making it applicable to
non-differentiable functions.
3. Numerical Stability: Less sensitive to initial guesses compared to open methods.
4. Simple Implementation: Easy to program and understand, making it ideal for
introductory numerical analysis.
Limitations
1. Slow Convergence: Since the error decreases linearly, it requires more iterations
compared to quadratically convergent methods like Newton-Raphson.
2. Requires Sign Change: The function must cross zero within the initial interval;
otherwise, the method fails.
3. Only Finds One Root: If multiple roots exist in [a,b], the bisection method will
find only one.
Applications
The bisection method is widely used in:
1. Engineering: Solving nonlinear equations in structural mechanics.
2. Physics: Finding equilibrium points in dynamic systems.
3. Economics: Calculating break-even points in financial models.
4. Computer Science: Optimizing algorithms that require root-finding.
Conclusion
The bisection method is a robust and reliable technique for root-finding, particularly
useful when dealing with
continuous functions where the root is known to lie within a specific interval.
Although it converges slowly
compared to more advanced methods, its simplicity and guaranteed convergence
make it a fundamental tool in
numerical analysis.
For functions that are differentiable and well-behaved, faster methods like Newton-
Raphson may be preferred.
However, when stability and certainty of convergence are required, the bisection
method remains an excellent
choice.
Algorithm (Step-by-Step)
1. Define the function f(x) and interval [a,b];
a1=a, b1=b, po=a;
2. i=1;
3. pi=1/2(ai+bi);
4. Check if |pi−pi-1|< ϵ then 10;
5. if f(pi) * f(ai) > 0, then 6;
if f(pi) * f(ai) < 0, then 8;
6. ai+1=pi, bi+1=bi;
7. i=i+1; go to 3;
8. ai+1=ai; bi+1=pi;
9. i=i+1; go to 3;
10. End of Procedure
Flowchart
VBA implementation of bisection method
Result in Excel Sheet
Iteration a b c (midpoint) f(c) Error (|b - a|)
1 2 3 2.5 5.625 1
2 2 2.5 2.25 1.890625 0.5
3 2 2.25 2.125 0.345703125 0.25
4 2 2.125 2.0625 -0.351318359 0.125
5 2.0625 2.125 2.09375 -0.00894165 0.0625
6 2.09375 2.125 2.109375 0.166835785 0.03125
7 2.09375 2.109375 2.1015625 0.07856226 0.015625
8 2.09375 2.1015625 2.09765625 0.034714282 0.0078125
9 2.09375 2.09765625 2.095703125 0.012862332 0.00390625
10 2.09375 2.095703125 2.094726563 0.001954348 0.001953125
11 2.09375 2.094726563 2.094238281 -0.003495149 0.000976563
12 2.094238281 2.094726563 2.094482422 -0.000770775 0.000488281
13 2.094482422 2.094726563 2.094604492 0.000591693 0.000244141
14 2.094482422 2.094604492 2.094543457 -8.95647E-05 0.00012207
Excel Functioning of Crittical load of column
Manual Calculations