0% found this document useful (0 votes)
12 views4 pages

Experiment No4

The document outlines Experiment No. 04, which focuses on implementing the Bisection Method using MATLAB to find roots of nonlinear equations. It explains the theory behind the method, its reliability, and provides MATLAB code for execution. The conclusion emphasizes the method's guaranteed convergence and robustness, making it a fundamental technique in numerical analysis despite being slower than other methods.

Uploaded by

tawhid.rifat2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

Experiment No4

The document outlines Experiment No. 04, which focuses on implementing the Bisection Method using MATLAB to find roots of nonlinear equations. It explains the theory behind the method, its reliability, and provides MATLAB code for execution. The conclusion emphasizes the method's guaranteed convergence and robustness, making it a fundamental technique in numerical analysis despite being slower than other methods.

Uploaded by

tawhid.rifat2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment No: 04

Experiment Name: Execution of Bisection Method using MATLAB.


Objective: The main objective of this experiment is to understand and implement the
Bisection Method for finding the roots of a nonlinear equation using MATLAB. The method is
based on the Intermediate Value Theorem and is used for solving equations of the form f(x)=0.

Theory: The bisection method is a simple and reliable numerical technique used to find the
roots of a continuous function. It works by repeatedly narrowing down an interval [a, b] in
which the function changes sign, indicating the presence of a root (i.e., where f(a)⋅f(b) < 0). At
each step, the method calculates the midpoint c = (a + b)/2 and evaluates the function at c.
Depending on the sign of f(c), the method replaces either a or b with c to create a smaller
interval still containing the root. This process continues until the interval is sufficiently small,
giving an approximation of the root. The method is guaranteed to converge for continuous
functions, making it a widely used technique in numerical analysis.

Apparatus:

1. MATLAB Software.

MATLAB Code:

>> f = inline('X^5 + X + 1', 'X');

eps_abs = 1e-4;

eps_step= 1e-4;

a = -1.0;

b = 0.0;

d = 0;

while (b-a >= eps_step || (abs(f(a)) >= eps_abs && abs(f(b)) >= eps_abs))

c = (a + b)/2

if f(c) == 0

break;
elseif f(a)*f(c) < 0

b = c;

else

a = c;

end

d = d+1

end

c=

-0.5000

d= 1

c=

-0.7500

d= 2

c=

-0.8750

d= 3

c=

-0.8125

d= 4

c=

-0.7812
d= 5

c=

-0.7656

d= 6

c=

-0.7578

d= 7

c=

-0.7539

d= 8

c=

-0.7559

d= 9

c=

-0.7549

d = 10

c=

-0.7544

d = 11

c=

-0.7546

d = 12
c=

-0.7548

d=

13

c = -0.7548

d=

>> a

a=

14 -0.7549

>> b

b = -0.7548

>> f(c)

ans =

1.4662e-04

Conclusion:

The bisection method is a reliable and easy-to-implement technique for finding roots of
continuous functions, particularly when a sign change is known within a specific interval. Its
guaranteed convergence makes it a dependable choice for solving nonlinear equations,
especially in cases where simplicity and stability are prioritized over speed. Although it may
be slower than methods like Newton-Raphson or the secant method—which utilize derivative
information—the bisection method remains a fundamental and widely used algorithm in
numerical analysis due to its robustness and effectiveness.

You might also like