0% found this document useful (0 votes)
91 views10 pages

Computational Methods in Process Engineering Lab Experiment - 1

This document describes a lab experiment to develop MATLAB/SciLab code for the bisection and regular false position methods to determine the drag coefficient needed for a parachutist with a mass of 68.1 kg to have a velocity of 40 m/s after falling for 10 seconds. The document provides the theory, algorithms, sample code, and results for both the bisection method and regular false position method. The conclusion is that the regular false position method converges faster, requiring only 4 iterations compared to 9 iterations for the bisection method.

Uploaded by

Dev
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)
91 views10 pages

Computational Methods in Process Engineering Lab Experiment - 1

This document describes a lab experiment to develop MATLAB/SciLab code for the bisection and regular false position methods to determine the drag coefficient needed for a parachutist with a mass of 68.1 kg to have a velocity of 40 m/s after falling for 10 seconds. The document provides the theory, algorithms, sample code, and results for both the bisection method and regular false position method. The conclusion is that the regular false position method converges faster, requiring only 4 iterations compared to 9 iterations for the bisection method.

Uploaded by

Dev
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/ 10

Name: Adithyadev Malikayil

Reg no: 19BCM0006

COMPUTATIONAL METHODS IN PROCESS ENGINEERING


LAB EXPERIMENT – 1
Aim:
To develop a MATLAB/Sci-lab code for bisection & Regula false position method.

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.

Note: The acceleration due to gravity is 9.81 m/s^2.

Theory:

Bisection method:

• Function f(x) is a real and continuous between the interval xl and xu

• Two initial guesses are required

• 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

Regular False Position Method:

• Function f(x) is a real and continuous between the interval xl and xu

• Two initial guesses are required

• The formula for estimation of root is given as xm = xu – f(xu)(xl-xu)/f(xl)-f(xu) 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 x.

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

Step 3: Now check the following


• 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.

Step 4: Find the new estimate of the root xm = (xl + xu)/ 2

Step 5: Find the absolute relative approximate error as

|€a| = | (xm new – xm old)/xm new | × 100

Where Xm new = estimated root from present iteration

Xm old = estimated root from previous iteration.

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.

Regular False position 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 = xu – f(xu)(xl-xu)/f(xl)-f(xu).

Step 3: Now check the following conditions

• 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.

Step 4: Find the new estimate of the root xm = xu – (f(xu)(xl-xu))/(f(xl)-f(xu))

Step 5: Find the absolute relative approximate error as:

|€a| =| (xm new – xm old)/xm new | × 100

Where Xm new = estimated root from present iteration

Xm old = estimated root from previous iteration

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:

disp('Name is: Adithyadev Malikayil')


disp('Registration No: 19BCM0006')
%function []=Nameof the file
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 guess is incorrect. New Guesses:\n');
x1=input('Enter the first value of guess intervals\n');
xu=input('Enter the end value of guess intervals\n');
end
fprintf('f(xu) is: %f\n',f(xu))
fprintf('f(x1) is %f\n',f(x1))
for i=2:1000
xr=xu-((f(xu)*(x1-xu)/f(x1)-f(xu)));%Regular Falsi
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)

Results and Discussion:

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.

___________________________________________________________________________

You might also like