You are on page 1of 20

BISECTION METHOD

BY FORTRAN
PROGRAMMING

PRESENTED BY- UNDER THE GUIDANCE OF-


1. Paritosh Suman Dr. Rabeet Singh
2. Parthiv Singh Chauhan Dr. Anirban Dutta
3. Pratap kumar (Dept. of Physics, B.H.U.)
CONTENT
 Mathematical approach of bisection
method
Programming for bisection method in
fortran
1.Algorithim
2.Flow chart
3.Program for bisection in fortran
4.Graphical representation of
equations 5.Advantage and
disadvantage
M AT H E M AT I C A L A P P RO A C H
⚫ To find the root of a simple equation we
use sridharacharya’s formula i.e.
−𝑏± 𝑏 2 −4𝑎𝑐
⚫ 𝑥=
2𝑎
⚫ Eg. 𝑥 2 + 5𝑥 + 6
⚫ By using sridharacharya’s formula we get the
root of this simple equation i.e. x= -2 and x= -
3
⚫ But what if we have to find the root of
polynomial of higher
order.
MATHEM ATICAL A P P R OA C H
⚫ The bisection method is used to find the root of
transcendental and polynomial function.
⚫ Eg.-𝑥2 − 4𝑥 + 3, 𝑥𝑒 𝑥 , xsin(x), etc….
⚫ It bisects the interval and then selects a sub-interval in
which the root must lie.
⚫ It then successively divides the interval in half and
replaces one endpoint with the midpoint so that the root is
bracketed.
⚫ Then solution is iteratively reached by narrowing down
the interval .
⚫ This method is based on the repeated application of
‘intermediate value theorem’.
INTERMEDI ATE VA L U E T H E O R E M
• If f(x) is real and
continuous function in the
interval a<x<b,

• And f(a) and f(b) have the


opposite signs, such that
f(a)*f(b)<0

• Then there exist at least


one real root between a and
b.
• There may be more than
one root in the interval.
INTERMEDI ATE VA L U E T H E O R E M
• Let, a and b. Let us also define
another point 𝒄 to be the middle
point between a and b
then, 𝑐 = 𝒂+𝒃
𝟐

Now, there exists the following three


conditions:
1. If f(c)=0, we have a root at c.
2. If f(c)*f(a)<0, then there is a
root between c and a.
3. If f(c)*f(b)<0, then there is a root
between c and b.
STEPS FOR B I S E C T I O N M E T H O D
 To solve bisection method problems we proceeds as
follows-
⚫ Step 1 : Choose two values, a and b such that,
f(a) >0 and f(b) < 0

or vice-versa.
⚫ Step 2 : Calculate a midpoint c as the arithmetic mean
between a and b such that
c = (a + b) / 2
This is called interval halving.
⚫ Step 3:Evaluate the function f(x) for the value of
c.
STEPS FOR B I S E C T I O N M E T H O D
⚫ Step 5 : If f(c) ≠ 0, then we need to check
• Step 6 : Then we replace a with c if f(c) has the
same sign as f(a) and we keep the same value for b.
⚫ Step 7 : We replace b with c if f(c) has the same
sign as
f(b), and we keep the same value for a.
⚫ Step 8 : Again if f(c)≠ 𝒐 To get the correct value with
the new value of a or b, we need to go back to step 2
And recalculate c.
⚫ Step 9 : And similarly we proceed many iterations and
narrow the interval until we achieve our root up-to
significant no. of decimal places.
P R O G R A M M I N G OF B I S E C T I O N M E T H O D
A LG O R I T H M
⚫ Programing bisection method.
⚫ Write implicit none
⚫ Define the required variables a, b and x.
⚫ Define the parameter (e=0.000001).
⚫ Take the input of values a and b.
⚫ If the absolute value of function f(x) is less
than the the parameter (e=0.000001) then print
the root of function and stop .
⚫ Calculate the value of 𝑥=(𝑎+𝑏)/2
⚫ Else if f(a)*f(x) is less than zero then a=x or
b=x..
⚫ End Program.
F LO W C H A R T
Input :
a,b

X=(a+b)/2

O utput : Root (x) Stop


|F(x)|
<0

F(a)*F(x)
<0

b=x a=x
P R O G R A M M I N G C O D E FOR B I S E C T I O N M E T H O D
OUTPUT
G R A P H I C A L REPRESENTATION
P R O G R A M M I N G C O D E FOR B I S E C T I O N M E T H O D
O U TPUT
G R A P H I C A L REPRESENTATION
A D VA N TA G E
⚫ This is a easy method of finding root of
a equation.
⚫ The bisection method is very simple and
easy to program on the computer.
⚫ Does not involve complex calculations.
⚫ The bisection method guarantees converges
to a root in an interval as long as the
function is continuous.
DISADVANTAGE
⚫ This method is very slow and
involves lengthy calculation.

⚫ Itcannot be used to find the complex


root.
T H A N K YO U

You might also like