Module - 1 - Updated 15 July 2020
Module - 1 - Updated 15 July 2020
Process Engineering
Reference book
Dorfman K.D., Daoutidis P, Numerical Methods with Chemical
Engineering Applications, 1st ed., Cambridge University Press,
USA, 2017
Module – 1:
Roots of equations
Module – 2:
Solution to simultaneous
linear algebraic equations
Module – 4:
Curve fitting and Interpolation
Module – 6:
Ordinary differential equations
Given
Given
Graphical solutions
Results are not precise
Tedious and awkward to implement
• Formulate (develop a
mathematical model)
• Solve
• Interpret
• Implement
F = ma
FU α - v => FU = -cv
where
dv F mg - cv
= =
dt m m
or
dv cv
= g -
dt m
c
gm - m t
v(t) = 1–e
c
where,
v(t) = dependent variable
t = independent variable
c, m = parameters
g = forcing function
12.5
9.81 m2/s x 68.1 kg - t
v(t) = 1 – e 68.1
12.5 kg/s
Terminal
Velocity
a=0
Net force = 0
c
gm - m t
v(t) = 1–e
c
Theorem
If function f(x) is a real and continuous
between the interval xl and xu
Please check
Solve what will happen
(1) x3 + 2x2 + 3 x - 4 = 0 with in the limits [0,1] if the Limits of
the problem (2)
(2) x3 - 2.7 x2 + 4.5 x – 6 = 0 with in the limits [1,3] becomes [1.5, 4]
Step - 2
Estimate the root, x m , 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 ( x m ) 0 , then the root lies between x and x m ; then x x and
xu x m .
b) If f ( x ) f ( x m ) 0 , then the root lies between x m and xu ; then x x m and
x u xu .
c) If f ( x ) f ( x m ) 0 ; then the root is x m . Stop the algorithm if this is true.
Step - 5
Find the absolute relative approximate error as
x mnew - x mold
a = new
100
xm
where
xmnew = estimated root from present iteration
xmold = estimated root from previous iteration
Compare the absolute relative approximate error a with the pre-specified relative error tolerance s
Step 1:
Step 2:
Step 3:
.
.
.
Step 5:
No yes
Step 1:
.
.
.
Step 5:
>> x = fzero(@(x)x^3-2.7*x^2+4.5*x-6,x0);
One can also use
“solver” option in
MS - Excel
50
Solution
x f(x)
1.96419 6.95E-05
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
Two triangles ABC and EDC B C
AB BC f ( xl ) xm xl D
= A
ED DC f ( xu ) xm xu
0 f ( xl ) 0 f ( xu ) Triangle 1 Triangle 2
xm xl xm xu
xu f xu xl f xu
xm
f xl f xu
(or)
f xu ( xl xu )
xm xU
f xl f xu
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 53
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
Compare the absolute relative approximate error a with the pre-specified relative error tolerance s
Note: Algorithmn in similar to bisection method except the formula to find the new
estimate.
CHE3001 Computational Methods in Process Engineering 55
Dr. Monash Purushothaman
Pitfalls of false position method
One-sided nature of
the expressions
i.e. one of the bound is
struck
When n is small - false position method is often significantly faster than the
bisection method
When n becomes large - false position often becomes the slowest method
Solve the following example and analyse with method converges fast- why?
Example: f(x) = x2 – 2 with in the limits [1,2] for an accuracy of 0.001 %
Step - 2
xl xu xu f xu xl f xu
xr xr
2 f xl f xu
f(xu)
Next estimate, xr Next estimate, xr f(xu)
xl
xl
xu
f(xl) xu
f(xl)
o Slope of tangent at xi is
f ( xi ) 0
f '( xi )
xi xi 1 A
AB f ( xi ) f ( xi )
tan( f '( xi ) xi 1 xi
AC xi xi 1 f ( xi )
f '' xi 2
f xi 1 f xi f ' xi xi 1 xi i 1 i
x x
2!
n
f ''' xi 3 f xi n
i 1 i
x x ........ i 1 i Rn
x x
3! n!
Truncate the expansion for first order Taylor series expansion, we get
f xi 1 f xi f ' xi xi 1 xi
Rearrange the above expression, we get
f ( xi )
xi 1 xi
f ( xi )
f(x0)
The Newton-Raphson method
requires the calculation of the
derivative of a function, which
tangent at f(x0) is not always easy.
f xi 1 xi
xi 1 xi 4
f ( xi 1 ) f ( xi )
1x
i 1
Step - 2
x-cos(x)=0
a
P 2 (v b) RT
V
Data - Van der Waals constants for carbon dioxide:
a = 3.61 L2 atm mol-2; b = 0.0428 L mol-1. R = 0.080206 L
atm/ mol K.
Specified error, εs = 0.001%.
Find the true percentage error for the obtained volume.
a
P 2 (v b) RT
V
Data - Van der Waals constants for carbon dioxide:
a = 3.592 Pa m6/kg2; b = 0.04267 m2/kg. R = 0.080206 J/
kg.K.
Specified error, εs = 0.001%.
General Equation
3r h
2
V πh
3
c 10 20(e0.15x e0.5x )
c 70e1.5t 25e0.075t
Determine the time required for the bacteria concentration to
be reduced to 9 using Newton-Raphson method with an initial
guess of t = 10 and a stopping criterion of 0.1%.
Suppose that we are processing a chemical A to generate a product B. For the case
where A forms B according to an autocatalytic reaction (that is, in which one of the
products acts as a catalyst or stimulus for the reaction), it can be shown that an
optimal recycle rate must satisfy
where XAf = the fraction of reactant A that is converted to product B. The optimal
recycle rate corresponds to the minimum-sized reactor needed to attain the desired
level of conversion. Use a numerical method to determine the recycle ratios
needed to minimize reactor size for a fractional conversion of XAf = 0.9.