Professional Documents
Culture Documents
Engineering(CHE3001)
Lab Asessment-01
• AIM
• Theory
• Algorithm
• Code
• Results And Discussions
• Conclussions
Algorithm for the bisection method
Step - 1
Choose x and xu as two guesses for the root such that f ( x ) f ( xu ) 0 , or in other words,
f (x) changes sign between x and xu
Step - 2
Estimate the root, xm , of the equation f ( x) 0 as the mid-point between x and xu as
Step - 3
Now check the following
a) If f ( x ) f ( xm ) 0 , then the root lies between x and xm ; then x x and
xu x m .
b) If f ( x ) f ( xm ) 0 , then the root lies between xm and xu ; then x xm and
xu xu .
c) 5 If f ( x ) f ( xm ) 0 ; then the root is xm . Stop the algorithm if this is true.
Compare the absolute relative approximate error a with the pre-specified relative error tolerance s
The function f(x) does not have any role in finding the new bound value
xm or xr
D C
B C
E
A E
0 f ( xl ) 0 f ( xu )
Triangle 1 Triangle 2
xm xl xm xu
xu f xl xl f xu xm f xl f xu
xu f xu xl f xu
xm
f xl f xu
(or)
f xu ( xl xu )
xm x9 U
f xl f xu
CHE3001 Computational Methods in Process Engineering
Algorithm for false position method
Step - 1
Choose x L and xU as two guesses for the root such that f x L f xU 0 , or in other
words, f x changes sign between x L and xU .
Step - 2
Step - 5
Find the absolute relative approximate error
where
xnew
x old
xmnew = estimated root from present iteration
a m
new
m
100
x m x mold = estimated root from previous iteration
Compare the absolute relative approximate error a with the pre-specified relative error tolerance s