CHE3001 Computational Methods in
Process Engineering
Instructor: Dr. P. Monash
School of Chemical Engineering (SCHEME)
VIT University Vellore
Date: 13 July 2020
Text book
Steven C. Chapra and Raymond P. canale “Numerical
Methods for Engineers” 7th edition, Mc Graw Hill Education,
2005.
Reference book
Dorfman K.D., Daoutidis P, Numerical Methods with Chemical
Engineering Applications, 1st ed., Cambridge University Press,
USA, 2017
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 2
Course Objectives:
• Formulate problems for roots of a function, solution of
simultaneous equations, optimized value of a given
function, numerical integration and differentiation, ODE and
PDE
• Solve roots of a function, simultaneous equations,
optimization, numerical integration, ODE and PDE
• Develop MATLAB code for finding the roots of a function,
solution of a simultaneous equations, optimization,
numerical integration, ODE and PDE
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 3
Course Outcomes (CO)
• Formulate engineering problem as mathematical model for an
appropriate solution using numerical methods
• Determine roots of a single equation and simultaneous equations
• Solve optimization, regression and numerical integration using
different methods
• Evaluate ordinary differential equation involving initial value and
boundary value problems
• Estimate the solution for partial differential equation involving
elliptical and parabolic equation
• Create MATLAB program for roots finding, simultaneous
equations, optimization, regression and curve fitting, numerical
integration, ODE and PDE
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 4
Syllabus
Module – 1:
Roots of equations
Solve f(x) = 0 for x.
Module – 2:
Solution to simultaneous
linear algebraic equations
Given the a’s and the c’s, solve
a11x1 + a12x2 = c1
a21x1 + a22x2 = c2
for the x’s.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 5
Module – 3:
Optimization
Determine x that gives optimum
f(x).
Module – 4:
Curve fitting and Interpolation
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 6
Module – 5:
Integration
I = ∫ f (x) dx
Find the area under the curve.
Module – 6:
Ordinary differential equations
Given
solve for y as a function of t.
yi + 1 = yi + f (ti , yi ) Δt
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 7
Module – 7:
Partial differential equations
Given
solve for u as a function of x and y
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 8
Assessment Methods
Assessment Date Max. Weightage Remarks
type Marks
Quiz 1 Almost every day 40 10 Five minute
Tests during
class till
CAT – I
Quiz 2 Almost every day 40 10 Five minute
Tests during
class till
CAT – II
Digital Submission before 31 50 10 Question and
Assignment October 2020 rubrics given
separately
CAT – I As per the announcement by the 15 Schedule will be
CAT – II University 15 announced by
the University
FAT 40
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 9
Introduction
Numerical methods are techniques by which mathematical
problems are formulated so that they can be solved with
arithmetic operations.
All numerical methods have one common characteristic -
invariably involve large numbers of tedious arithmetic
calculations.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 10
Approaches used for solving Engineering
Problems
Analytical or Exact solution
Limited class of problems
Graphical solutions
Results are not precise
Tedious and awkward to implement
Solutions using calculators or slide rulers
Slow and tedious
Possibilities of manual mistakes
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 11
The sizes of the boxes indicate the level of emphasis directed toward each phase.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 12
Steps involved in
problem solving
• Formulate (develop a
mathematical model)
• Solve
• Interpret
• Implement
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 13
Simple mathematical model
Mathematical model can be broadly defined as a formulation
or equation that expresses the essential features of a
physical system or process in mathematical terms.
independent , parameters, forcing
Dependent variable = f
variables functions
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 14
Example – Model formulation
(Falling Parachutist)
Newton’s second law can be used to
determine the terminal velocity of a free
falling body near the earth’s surface.
F = ma
The mathematical model for this case is
derived by expressing the acceleration
as a time rate of change of velocity (a =
dv/dt)
dv F FD + FU
= =
dt m m
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 15
The downward force due to gravity FD = mg
A simple formulation for the air resistance is to assume that
it is linearly proportional to velocity (linear approximation)
FU α - v => FU = -cv
where
c = proportionality constant (drag coefficient kg/s)
Accounts for properties of the falling body.
e.g. shape, surface roughness, etc.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 16
The net force is the difference between the downward force
and the upward force
dv F mg - cv
= =
dt m m
or
dv cv
= g -
dt m
The above mathematical model relates to the acceleration of
a falling object to forces acting on it.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 17
Exact solution / Analytical solution
If the parachutist is initially at rest (v = 0 at t = 0), we can use
calculus to find the solution of:
c
gm - m t
v(t) = 1–e
c
where,
v(t) = dependent variable
t = independent variable
c, m = parameters
g = forcing function
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 18
Exact solution – In detail
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 19
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 20
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 21
Analytical solution to the falling parachutist
A parachutist of mass 68.1 kg jumps out of a stationary
helicopter. Use the equation to compute the velocity prior to
opening the parachute. The drag coefficient is equal to 12.5
kg/s.
The velocity at any time is given by
12.5
9.81 m2/s x 68.1 kg - t
v(t) = 1 – e 68.1
12.5 kg/s
v(t) = 53.39 1 – e– 0.18355 t
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 22
We can use the model to compute v at different times
Terminal
Velocity
a=0
Net force = 0
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 23
The equation is called an analytical or exact solution because
it satisfies the original differential equation exactly.
Many mathematical models cannot be solved exactly.
Alternative is to develop a numerical solution that
approximates the exact solution
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 24
Finding the velocity of a parachutist
Determine the drag coefficient, c, needed for a parachutist of
mass m = 68 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/s2.
c
gm - m t
v(t) = 1–e
c
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 25
c f(C)
Graphical Procedure 1 51.19385
2 44.96048
c 3 39.2952
gm - m t
f(c) = 1–e -v=0 4 34.13976
c 5 29.4423
6 25.15657
7 21.24136
This is of the form f(x) = 0
8 17.65987
9 14.37924
10 11.37013
11 8.606282
12 6.064206
13 3.722867
14 1.563414
15 -0.43106
16 -2.27573
17 -3.98424
18 -5.56883
19 -7.04053
20 -8.40928
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 26
=9.81*68/A1*(1-EXP(-A1*10/68))-40
The drag coefficient value, c = 14.77 kg/s
If we use numerical techniques, we can get more accurate
drag coefficient value, c = 14.7793951186285 kg/s
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 27
Roots of a equation
Earlier methods
Graphical methods
Trial and error methods
Type of functions in root finding
Algebraic
e.g. Polynomials are simple class of algebraic functions
Transcendental – nonalgebraic functions, which includes trigonometric,
exponential, logarithmic and less familiar functions
e.g.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 28
Error Definitions
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 29
Bisection Method
• Bracketing - Two initial guesses are required
• Bisection Method (also named as interval halving, binary
chopping, Bolzano’s Method)
Theorem f (x) Xi = (xL + xU)/2
If function f(x) is a real and
continuous between the interval xl
and xu
If f(xl) and f(xu) have opposite
sign i.e. if f(xl) f(xu) < 0 - there is
at least one real root between xl xℓ
x
and xu xu
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 30
f (x)
Theorem
If function f(x) is a real and continuous
between the interval xl and xu
If f(xl) and f(xu) does not change sign
between two points i.e. if f(xl) f(xu) > 0 ,
roots of the equation f(x) = 0 may still x
exist between the two points xℓ xu
Theorem
If function f(x) is a real and continuous
between the interval xl and xu
If f(xl) and f(xu) does not change sign
between two points i.e. if f(xl) f(xu) > 0,
there may not be any roots for the
equation f(x) = 0 between the two
points
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 31
Theorem
If function f(x) is a real and continuous
between the interval xl and xu
If f(xl) and f(xu) changes sign between
two points i.e. if f(xl) f(xu) < 0, more
than one root for the equation f(x) = 0
may exist between the two points
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]
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 32
Advantages and drawbacks BS Method
Advantages
Always convergent
Error can be controlled - guaranteed
Drawbacks
convergence is slow, if one
of the initial guesses is
close to the root
e.g. f(x) = sin(x)
For case 1: Take the limits [2, 4]
For case 2: Take the limits [3, 4]
Check which one requires more
iteration to converge
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 33
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, 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.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 34
Step - 4
Find the new estimate of the root
x xu
xm =
2
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
If a s , then go to Step 3, else stop the algorithm.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 35
Matlab code to find “Drag coefficient of the parachutist
using bisection method
Step 1:
Step 2:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 36
Step 2: updated with calculation of xm (modified root)
Step 3:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 37
Step 4:
.
.
.
Step 5:
No yes
Print the results and exit
the program
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 38
Overall matlab code – Bisection method
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 39
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 40
solution:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 41
Scilab code to find “Drag coefficient of the parachutist
using bisection method
Step 1:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 42
Step 2:
Step 2: updated with calculation of xm (modified root)
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 43
Step 3:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 44
Step 4:
.
.
.
Step 5:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 45
Overall Scilab code – Bisection method
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 46
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 47
solution:
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 48
Finding roots using simple commands
oUse “fzero” command in Matlab o Use “Goal Seek” option in Excel
>> x0=[1 3];
>> x = fzero(@(x)x^3-2.7*x^2+4.5*x-6,x0);
One can also use
“solver” option in
MS - Excel
o Use “root” option in Mathcad
One can also use “fsolve”
option in Matlab to find the
root
Analyze the difference
between fzero and fsolve
command
Hint: use Help command in
Matlab
e.g. >>help fsolve
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 49
Goal Seek option in MS-Excel
50
Solution
x f(x)
1.96419 6.95E-05
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 50
Regula falsi or false position method
•Also named as method of false position or linear interpolation
method
Concerns in Bisection method
Convergence process in the bisection method is very slow
It depends only on the choice of end points of the interval [a,b].
The function f(x) does not have any role in finding the new bound value xm or xr
Condition of flase position method
Function f(x) is a real and continuous between the interval xl and xu
The functions f(xl) and f(xu) have opposite sign
i.e. if f(xl) f(xu) < 0
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 51
False position method - Basics
•A better approximation of xm or xr can be obtained by taking
the straight line or chord joining the points (xl, f(xl) and xu,
f(xu)) intersecting the x-axis.
Properties of similar triangle
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
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 52
From the two similar
triangles, we get
0 f ( xl ) 0 f ( xu ) Triangle 1 Triangle 2
xm xl xm xu
Rearranging the above equation
xm xl f xu xm xu f xl
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 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
Estimate the new root, xr or xm , of the equation f x 0 from the derived
expression for false position method
One less function
f xU ( xL xU ) evaluation than
xm (or) xr xU the other
f xL f xU expression
Step - 3
Check the condition
If f x L f x m 0 , then the root lies between x L and x m ; then x L x L and xU x m
If f x L f x m 0 , then the root lies between x m and xU ; then x L x m and xU xU
If f x L f x m 0 , then the root is x m , Hence stop the algorithm
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 54
Step - 4
Find the new estimate of the root
f xU ( xL xU ) This becomes xmold for next iteration and
xm xU
f xL f xU the newly calculated value becomes x mnew
Step - 5
Find the absolute relative approximate error
where
new old
x
m x m x mnew = estimated root from present iteration
a new
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
If a s , then go to Step 3, else stop the algorithm.
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
Suppose if the function
f(x) = x10-1
One-sided nature of
the expressions
i.e. one of the bound is
struck
One-sided nature of the expressions results in one of
Solution for the above situations
the bound to struck. In such cases the function value
Modified false position Method of the stagnant bound is divided in to half – to fasten
the convergence
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 56
When to use bisection or Regula falsi method
e.g. f(x) = xn –2
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 %
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 57
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
Estimate the new root, xr or xm , of the equation f x 0 from the derived
expression for false position method
One less function
f xU ( xL xU ) evaluation than
xm (or) xr xU the other
f xL f xU expression
Step - 3
Check the condition
If f x L f x m 0 , then the root lies between x L and x m ; then x L x L and xU x m
If f x L f x m 0 , then the root lies between x m and xU ; then x L x m and xU xU
If f x L f x m 0 , then the root is x m , Hence stop the algorithm
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 58
Finding roots of equation – Open methods
Bisection method False position method
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 Open methods Characteristics
Fixed point iteration method Initial estimates need not bracket the root
single starting value
Two curve graphical method
two starting values –need not bracket the root
Newton-Raphson method
Generally converge faster
Secant method NOT guaranteed to converge
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 59
Newton-Raphson method
oVery efficient method for real
functions
oQuadratic convergence: the
number of correct digits doubles
every iteration
oPossibility to not converge
oRequires the calculation of the
function's derivative:
First described by Issac Newton in 1669
Joseph Raphson published a simplified
version in 1690
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 60
Newton-Raphson method - Geometrical Derivation
o Slope of tangent at xi is
f ( xi ) 0
f '( xi )
xi xi 1 A
o Solve for xi+1
)θ
f ( xi )
xi 1 xi C
f ( xi ) B
AB f ( xi ) f ( xi )
tan( f '( xi ) xi 1 xi
AC xi xi 1 f ( xi )
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 61
Newton-Raphson method
Taylor series expansion
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 )
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 62
Newton-Raphson method
f(x0)
The Newton-Raphson method
requires the calculation of the
derivative of a function, which
tangent at f(x0) is not always easy.
When the step is too large or
the value is oscillating, other
more conservative methods
should take over the case.
The
initial
guess
f(x1)
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 63
Pitfalls of Newton-Raphson method
Inflection point in the neighbor of a root Oscilation between maximum or minimum
Jumps in functions with several roots Existence of a null derivative
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 64
Secant method
False position method Assumptions
2 Two initial points xi and xi 1 such
3
that f ( xi ) f ( xi 1 ) , then the new
4
estimate obtained by backward finite
difference method
f xi 1 f xi
f '( xi )
xi 1 xi
1
Rearrangement of the Secant method
approximation yields the xi 2
3
required iterative
expression
f xi 1 xi
xi 1 xi 4
f ( xi 1 ) f ( xi )
1x
i 1
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 65
AB DC f ( xi ) f ( xi 1 ) f ( xi )( xi xi 1 )
xi 1 xi
AE DE xi xi 1 xi 1 xi 1 f ( xi ) f ( xi 1 )
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 66
Secant method – advantage and disadvantage
oAdvantage of the secant method
It can converge even faster and it doesn’t need to bracket the root
oDisadvantage of the secant method
It is not guaranteed to converge
It may diverge
Modified secant method
( xi 1 xi )
Fractional
perturbation
xi f ( xi )
xi 1 xi
f ( xi xi ) f ( xi )
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 67
Algorithm
Step - 1
Evaluate f x symbolically Only for Newton-
Raphson method
Step - 2
Estimate the new value of the root, xi 1 , as
Use initial guess (xi) for NR Method Use initial guesses as (xi and xi-1) for
secant method
f ( xi )
xi 1 xi f ( xi )( xi xi 1 )
f ( xi ) xi 1 xi
f ( xi ) f ( xi 1 )
Step - 3
Find the absolute relative approximate error a as
xi 1 xi
a 100
xi 1
If a > s , then go to Step 2, else stop the algorithm
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 68
Comparison of the root finding methods
Method Pros Cons
Bisection - Easy, Reliable, Convergent - Slow
- One function evaluation per iteration - Needs an interval [a,b] containing
- No knowledge of derivative is needed the root, i.e., f(a)f(b)<0
False - Easy, Reliable, Convergent - Faster than bisection method
position - One function evaluation per iteration - Needs an interval [a,b] containing
- No knowledge of derivative is needed the root, i.e., f(a)f(b)<0
Newton - Fast (if near the root) - May diverge
- Two function evaluations per iteration - Needs derivative and an initial guess
x0 such that f’(x0) is nonzero
Secant - Fast (slower than Newton) - May diverge
- One function evaluation per iteration - Needs two initial points guess x0, x1
- No knowledge of derivative is needed such that f(x0)- f(x1) is nonzero
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 69
Comparison – Example
Example: x-cos(x)=0, for13 correct digits requires
o 4 iterations of Newton [x0=0.8]
o 43 iterations of Bisection method (initial interval [0.6, 0.8]
o 5 iterations of Secant method [0.6, 0.8]
x-cos(x)=0
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 70
Case study - 1
Carbon dioxide gas (1 mole) is at 373 K and 50 atm. Find the
volume of the gas using Van der Waals equation.
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.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 71
Case study
Carbon dioxide gas (1 mole) is at 300 K and 1 atm. Find the
volume of the gas using Van der Waals equation.
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%.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 72
Case study
Determine the molar volume of saturated water in the liquid
and vapor phases at temperature of 523 K using Newton-
Raphson method. The molar volume is given by Vander
Waals equation of state.
a
P 2 (v b) RT
V
The vapor pressure of water at 523 K at 40 bar (1 bar = 1×105
N/m2). Here, a = 0.5534 Nm4/mol2 and b = 3.049×10-5 m3/mol.
Take R= 8.314 Nm/mol.K. Stopping criterion, εs = 0.001%.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 73
Case Study - 2
A 6 ft diameter spherical storage tank containing oil is attached
with a dipstick of 8 ft long as shown in the Figure.
The equation that gives the height, h, of the liquid in the
spherical tank for the given volume and radius is given by
3 2
f (h) h 9h 3.8197 0
Use numerical method to find the height, h, to which the
dipstick is wet with oil. Specified error, εs = 0.5%.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 74
Case Study
A 6 ft diameter spherical storage tank containing oil is attached
with a dipstick of 8 ft long as shown in the Figure.
General Equation
3r h
2
V πh
3
Develop an equation that gives the height, h, of the liquid in the
spherical tank for the given volume and radius.
If r = 5 ft and volume = 400 ft3, find the height, h, to which the
dipstick is wet with oil. Specified error, εs = 0.5%.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 75
Case study - 3
Suppose you are asked to cut a rectangular sheet with one of
its sides 1.25 m longer than the other and the area being
0.875 m2 from a thin iron sheet of 5 m2 area. What will be the
length of the ‘smallest side’?
Use bisection method to find the smallest side and compare
the result with analytical solution.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 76
Case study - 4
In environmental engineering, the following equation can be
used to compute the oxygen level ‘c’ (mg/L) in a river
downstream from a sewage discharge:
c 10 20(e0.15x e0.5x )
Determine the downstream distance, x, where the oxygen
level first falls to a reading of 5 mg/L using Secant method for
a specified error of 0.001%.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 77
Case study
The concentration of pollutant bacteria c in a lake decreases
according to the following equation.
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%.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 78
In chemical engineering, plug flow reactors are often used to convert reactants into
products. It has been determined that the efficiency of the conversion can
sometimes be improved by recycling a portion of the product stream so that it
returns to the entrance for an additional pass through the reactor.
The recycle rate is defined as R = volume of fluid returned to entrance/volume
leaving the system
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.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 79
Case study
In a chemical engineering process, water vapor (H2O) is
heated to sufficiently high temperatures that a signifi cant
portion of the water dissociates, or splits apart, to form
oxygen (O2) and hydrogen (H2):
If it is assumed that this is the only reaction involved, the
mole fraction x of H2O that dissociates can be represented by
where K = the reaction equilibrium constant and pt = the total
pressure of the mixture.
If pt = 3 atm and K = 0.05, determine the value of x using
numerical method.
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 80
Other Methods
•Muller’s method
•Bairstow’s method
•Ridders’s method
•Brent method
•Lagurre’s method
•Jenkins-Traub method
•Ralston and Rabinowitz method
Dr. Monash Purushothaman CHE3001 Computational Methods in Process Engineering 81