Nmche 1 11 2 24
Nmche 1 11 2 24
(CB 424)
Text Books:
1. S. C. Chapra, R. P. Canale, Numerical methods for engineers, 7th Ed. Tata-
McGraw-Hill, 2015
2. S. K. Gupta, Numerical methods for engineers, New Age International, 2001
Numerical Methods in Chemical Engineering
Grading
• Mid-sem 30%
• End-sem 40%
• Assignments and quiz 10+10%
• Class participation and interactions 10%
Class Timings
Tuesday: 10:00 – 11:55 AM
Thursday: 09:00 – 09:55 AM
Numerical Methods in Chemical Engineering
MODELING, COMPUTERS, AND ERROR ANALYSIS
• Noncomputer Methods
• Analytical or exact methods
• Graphical solutions
• Calculators
• Development of numerical methods
• Capable of handling large systems of equations, nonlinearities, and
complicated geometries
• The intelligent use of these programs is often predicated on knowledge of
the basic theory underlying the methods.
• An effective way to learn programming and can design a programs to
solve problems
Numerical Methods in Chemical Engineering
Mathematical Background
• Roots of Equations
• Solve f(x) = 0 for x.
• Curve fitting
Numerical Methods in Chemical Engineering
Mathematical Background
• Integration
∫
I= ( )
•
Roots of Equations
• Bracketing Methods
• Graphical Methods
• The Bisection Method
• The False-position Method
• Open Methods
• Simple Fixed-point Iteration
• The Newton-Raphson Method
• The Secant Method
Numerical Methods in Chemical Engineering
• Graphical Method
• Can be utilized to obtain rough estimates of
roots.
• In general, if f(x) is real and continuous in the
interval from xl to xu and f(xl) and f(xu) have
opposite signs: f(xl) f(xu) < 0
(1 − )−
−( )
( )=
−
= 100%
668.06
(1 − ) − 40
−0.146843
( )=
𝑟
𝑥
𝑛
𝑒
𝑤
𝑎
𝑐
𝜀
𝑟
𝑟
𝑓
𝑐
𝑒
𝑥
𝑥
𝑐
𝑛
𝑒
𝑤
𝑜
𝑙
𝑑
Numerical Methods in Chemical Engineering
• The False-position Method
• It is also called the linear interpolation method
( ) ( )
=
− −
( )( − )
= −
( )− ( )
• Determine the root of the below equation
668.06
(1 − ) − 40
−0.146843
( )=
𝑙
𝑢
𝑟
𝑙
𝑟
𝑢
𝑓
𝑥
𝑓
𝑥
𝑥
𝑥
𝑥
𝑥
𝑐
𝑟
𝑢
𝑥
𝑥
𝑓
𝑐
𝑒
𝑙
𝑢
𝑢
𝑙
𝑢
𝑐
𝑓
𝑥
𝑓
𝑓
𝑥
𝑥
𝑥
𝑥
Numerical Methods in Chemical Engineering
• Bisection vs False-position
Numerical Methods in Chemical Engineering
Roots of Equations
• Bracketing Methods
• Graphical Methods
• The Bisection Method
• The False-position Method
• Open Methods
• Simple Fixed-point Iteration
• The Newton-Raphson Method
• The Secant Method
Numerical Methods in Chemical Engineering
• Open Methods
• Open methods employ a formula
to predict the root
• Sometimes diverge or move
away from the true root
• When the open methods
converge, they usually do so
much more quickly than the
bracketing methods
Numerical Methods in Chemical Engineering
• Convergence
Numerical Methods in Chemical Engineering
• Newton-Raphson Method
( )−0
′( ) =
− +1
( )
= −
′( )
+1
𝑖
𝑖
𝑖
𝑓

𝑥
𝑥
𝑥
𝑖
𝑖
𝑖
𝑓
𝑥

𝑥
𝑥
𝑖
𝑖
𝑓
𝑥
𝑓
𝑥
Numerical Methods in Chemical Engineering
• Secant Method
• This approach requires two initial estimates of x
• f(x) is not required to change signs between the estimates
( −1) − ( ) ( )( − )
′( ) ≅
−1
= −
( −1) − ( )
+1
−1 −
( + )− ( ) ( )
′( ) ≅
𝑖
𝑖
= −
𝑖
𝑥
𝛿
𝑥
𝑥
𝑖
𝑖
𝑖
𝑖
𝑖
𝑓
𝑓
𝑥
𝑥
𝛿
𝑥
𝑓
𝑥
𝑓
𝑥
( + )− ( )
+1
𝑖
𝑖
𝑖
𝑖
𝑖
𝑖
𝑓
𝑓


𝑥
𝑥
𝑥
𝑥
𝑥
𝑥
𝑖
𝑖
𝑖
𝑖
𝑖
𝑖
𝑖
𝑖
𝑖
𝑖
𝑓
𝑓
𝑥
𝑥
𝛿
𝑥
𝑓
𝑥
𝑓
𝑥
𝑓
𝑥
𝛿
𝑥
𝑥
𝑓
𝑥
𝑥
Numerical Methods in Chemical Engineering
Example:
• Use the Secant method to estimate the root of f(x) = e-x – x. Start
with initial estimates of x-1 = 0 and x0 = 1.
• Use the modified secant method to estimate the root of f(x) = e-x –
x. Use a value of 0.01 for and start with x0 = 1.0. Recall that the
true root is 0.56714329. . . .
𝛿
Numerical Methods in Chemical Engineering
• The polynomial
( ) = 0.0074 4 − 0.284 3 + 3.355 2 − 12.183 + 5
has a real root between 15 and 20. Apply the Newton- Raphson method to
this function using an initial guess of x0 = 16.15. Explain your results.
𝑓
𝑓
𝑥
𝑥
𝑥
𝑥
𝑥
𝑥
𝑥
𝑥
Numerical Methods in Chemical Engineering
a) Graphically.
b) Using bisection to determine the root to es = 10%. Employ initial guesses
of xl = 0.5 and xu = 1.0.
c) Perform the same computation as in (b) but use the false-position method
and es = 0.2%.
𝑓
𝑥
𝑥
𝑥
𝑥
𝑥
𝑥
Numerical Methods in Chemical Engineering
MULTIPLE ROOTS
• Double root: f(x) = (x - 3)(x - 1)(x - 1) or f(x) = x3 - 5x2 + 7x - 3
•
Numerical Methods in Chemical Engineering
• Fixed-Point Iteration
[ ]= [ ]+ ∑[ ] [ ]
( +1) ( ) ( +1) ( )
−
=1 ( )
1 1
. .. 1
1[ ]
( ) ( +1) ( )
1 2
1 − 1
2[ ]
( ) ( +1) ( )
2 2
. .. 2
2 − 2
− . = .
1 2
.
. .
𝑥
.
𝑘
𝑁
. .
𝜕
𝑥
𝜕
𝑥
𝜕
𝑥
.
𝑁
𝑁
𝑁
[ ]
𝑁
𝑁
𝑁
𝐹
𝑥
𝑥
𝑥
𝜕
𝐹
𝜕
𝐹
𝜕
𝐹
( ) ( +1) ( )
−
𝑘
𝑘
𝑘
. ..
1 2 ( )
− [ ( )
]= [
( )
][
( +1) ( )
]
𝑁
−
𝜕
𝑥
𝜕
𝑥
𝜕
𝑥
𝑥
𝑥
𝐹
𝑥
𝑘
𝑘
𝑘
𝑥
𝑘
𝑗
𝜕
𝐹
𝜕
𝐹
𝜕
𝐹
𝑗
𝜕
𝑥
𝑗
𝑗
𝑖
𝑖
𝑥
𝑥
𝑁
𝐹
𝑥
𝜕
𝑥
𝜕
𝑥
𝜕
𝑥
𝐹
𝑥
𝐹
𝑥
𝑥
𝑥
𝑘
𝑘
𝑘
𝑘
𝑘
𝑘
𝑘
𝑖
𝜕
𝐹
𝑖
𝑭
𝑥
𝑨
𝑥
𝑥
𝑥
𝐹
𝑥
𝑖
𝑁
𝜕
𝐹
𝜕
𝐹
𝜕
𝐹
𝑁
𝑘
𝑘
𝑘
𝑘
Numerical Methods in Chemical Engineering
• Multivariable Newton-Raphson
− [ ( )
]= [
( )
][
( +1)
− ]
( )
( +1)
= ( )
−[ ( ) −1
] [
( )
]
Example:
• 1( ) = 4 − 8
3
2+4 3−2 2 =0
• 2( ) = 1 − 4
2
2+3 3+ 3 =0
•
(1)
=[ 2 3 ]
(1) (1)
= [0.5 0.5]
𝑦
𝑦
𝑦
𝑥
𝑥
𝐴
𝐹
𝑥
𝐹
𝐹
𝑭
𝑦
𝑦
𝑥
𝑨
𝑦
𝑦
𝑥
𝑦
𝑦
𝑥
𝑦
𝑦
𝑥
𝑇
𝑘
𝑘
𝑘
𝑘
𝑘
𝑘
𝑘
𝑘
𝑇
Numerical Methods in Chemical Engineering
Numerical Methods in Chemical Engineering
Error Definitions
• Truncation errors:
• Round-off errors:
• True value
• Exact value of the error/True error, Et
• True fractional relative error
• True percent relative error εt
• εa =(approximate error/approximation) * 100%
• εa =((current approximation - previous approximation)/current) *
100%