Computational Methods in Process Engineering Lab Experiment - 1
Computational Methods in Process Engineering Lab Experiment - 1
Problem Statement:
Determine the drag coefficient (c) needed for a parachutist of mass m=68.1 kg to have a
velocity of 40 m/s after free falling for time t = 10 s.
Theory:
Bisection method:
• The formula for estimation of root is given as xm = (xl + xu)/ 2 where xl and xu are two
guesses for the root such that f(xl)f(xu)< 0, i.e., f (x) changes sign between xl and xu
Algorithm:
Bisection method:
Step 1: Choose xl and xu as two guesses for the root such that f(xl)f(xu)< 0, or in other
words, f(x) changes sign between xl and xu.
Step 2: Estimate the root, xm of the equation f (x) = 0 as the mid-point between as xl and xu
as xm = (xl + xu)/ 2
• If f(xl)f(xm) > 0 then the root lies between xm and xu; then xl = xm and xu=xu
• If f(xl)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.
Step 1: Choose xl and xu as two guesses for the root such that f(xl)f(xu)< 0, or in other
words, f(x) changes sign between xl and xu.
Step 2: Estimate the root, xm of the equation f (x) = 0 as the mid-point between as xl and xu
as:
xm = xu – f(xu)(xl-xu)/f(xl)-f(xu).
• If f(xl)f(xm) < 0 then the root lies between xl and xm; then xl = xl and xu=xm
• If f(xl)f(xm) > 0 then the root lies between xm and xu; then xl = xm and xu=xu
• If f(xl)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. If |€a| > €s then go to Step 3, else stop the algorithm.
Code:
• Bisection Method:
Code:
function untit
disp('Name is: Adithyadev Malikayil')
disp('Registration No: 19BCM0006')
syms c
f(c)=(668.06/c)*(1-exp(-0.146843*c))-40;
x1=10;
xu=16;
tol=0.001;
if f(xu)*f(x1)<0
else
disp('initial guesses are incorrect')
fprintf('The guesses are incorrect. Enter New guesses\n');
x1=input('Enter the first values of guessed interval:\n');
xu=input('Enter the second value of guessed interval: \n');
end
%disp(f(x1))
fprintf('f(x1) is: %f\n',f(x1))
fprintf('fprint is %f',f(xu))
for i=2:1000
xr=(xu+x1)/2; %Bisection Method
if f(xu)*f(xr)<0
x1=xr;
else
xu=xr;
end
if f(x1)*f(xr)<0
xu=xr;
else
x1=xr;
end
xnew(1)=0;
xnew(1)=xr;
if abs((xnew(1)-xnew(i-1))/xnew(1))<tol
break;
end
i
xr
end
fprintf('Exact root for the given problem is %f',xr)
• Regular False Position Method
Code:
Bisection Method:
• Regular False Position Method
-
Conclusion:
We obtain 9 iterations for bisection method and 4 iterations for regular false position method.
The exact root that is observed to be obtained in bisection method is 14.792969. The exact
root obtained in regular false position method is 14.802409.
This we can conclude that False position method is significantly faster than the bisection
method because of the number of iterations for false position method are less as compared to
bisection method.
___________________________________________________________________________