0% found this document useful (0 votes)
19 views32 pages

Nmche 1 11 2 24

This document provides information about the Numerical Methods in Chemical Engineering course offered at Indian Institute of Technology Patna. The course covers various numerical methods for solving equations, fitting curves, integration, and solving ordinary and partial differential equations. It will also teach implementing numerical methods in programming languages like FORTRAN and MATLAB. The document details the syllabus, textbooks, grading scheme, class timings, and provides examples of mathematical concepts covered in the course like roots of equations, linear algebra, integration, and approximation of errors.

Uploaded by

laksh.iitp
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)
19 views32 pages

Nmche 1 11 2 24

This document provides information about the Numerical Methods in Chemical Engineering course offered at Indian Institute of Technology Patna. The course covers various numerical methods for solving equations, fitting curves, integration, and solving ordinary and partial differential equations. It will also teach implementing numerical methods in programming languages like FORTRAN and MATLAB. The document details the syllabus, textbooks, grading scheme, class timings, and provides examples of mathematical concepts covered in the course like roots of equations, linear algebra, integration, and approximation of errors.

Uploaded by

laksh.iitp
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/ 32

Numerical Methods in Chemical Engineering

(CB 424)

Chemical and Biochemical Engineering


Indian Institute of Technology Patna

Dr. Priyanka Gupta


[email protected]
Numerical Methods in Chemical Engineering
Course syllabus
Solution of simultaneous linear and non-linear equations; Eigenvalues and
eigenvectors of matrices; Statistical analysis of data; Curve fitting;
Approximation of functions; Interpolation; Numerical integration and
differentiation; Solution of ordinary differential equations - initial and boundary
value problems; Solution of partial differential equations; Analysis of error and
stability in numerical computing; Implementation of numerical methods on
computer through programming in FORTRAN/C++ and commercial software
such as MATLAB.

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.

• Linear Algebraic Equations


• a11x1 + a12x2 = c1
• a21x1 + a22x2 = c2

• Curve fitting
Numerical Methods in Chemical Engineering
Mathematical Background
• Integration


I= ( )

• Ordinary differential equations



• = = (, )

• +1 = + ( , ) ∆

• Partial differential equations


𝑎
2 2
= ( , )
𝜕
𝑥
𝜕
𝑦
+
𝑑
𝑡
𝑡
𝑓
𝑥
𝑑
𝑥

𝑓
𝑥
𝑦
2 2
𝑓
𝑡
𝑦
𝑖
𝑖
𝑖
𝑖
𝑦
𝑦
𝑓
𝑡
𝑦
𝑡
𝜕
𝑢
𝜕
𝑢
𝑑
𝑦
𝑦
𝑏
Numerical Methods in Chemical Engineering

Approximations and Round-Off Errors


• The two major forms of numerical error
• Round-off error Assignment 1
• Truncation error
• The significant digits of a number are those that can be used with
confidence.
• π, e, or sqrt(7) represent specific quantities. For example π =
3.141592653589793238462643…
• Accuracy: how closely a computed or measured value agrees with the
true value.
• Precision: how closely individual computed or measured values agree
with each other.
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

• 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

• Use the graphical approach to determine the c

(1 − )−
−( )
( )=

t =10s, g = 9.81, v = 40, and m = 68.1


𝑐
𝑓
𝑐
𝑒
𝑣
𝑚
𝑡
𝑐
𝑚
𝑔
Numerical Methods in Chemical Engineering

• Roots can occur or be absent in an


interval prescribed by a lower
bound xl and an upper bound xu
Numerical Methods in Chemical Engineering

• Incremental search methods

• The Bisection Method


• Alternatively called binary chopping, interval halving, or Bolzano’s method
• If a function changes sign over an interval, the function value at the midpoint
is evaluated
Numerical Methods in Chemical Engineering
Algorithm for the bisection calculation
• Step 1: Choose lower xl and upper xu guesses for the root such that the function
changes sign over the interval. This can be checked by ensuring that f(xl) f(xu) < 0.
• Step 2: An estimate of the root xr is determined by xr = (xl + xu)/2
• Step 3: Make the following evaluations to determine in which subinterval the root
lies:
• (a) If f(xl) f(xr) < 0, the root lies in the lower subinterval. Therefore, set xu = xr
and return to step 2.
• (b) If f(xl) f(xr) > 0, the root lies in the upper subinterval. Therefore, set xl = xr
and return to step 2.
• (c) If f(xl) f(xr) = 0, the root equals xr; terminate the computation.
Numerical Methods in Chemical Engineering

• Termination Criteria and Error Estimates


= 100%

• Use the Bisection Method to determine the c

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

• Simple Fixed-point Iteration

• Solve f(x) = e-x – x


• Re-write as x = g(x) by isolating x
• Separated directly and expressed in
the form of xi+1 = e-xi
• Starting with an initial guess of x0 = 0
• The true value of the root:
0.56714329
Numerical Methods in Chemical Engineering

• Convergence
Numerical Methods in Chemical Engineering

• Newton-Raphson Method

( )−0
′( ) =
− +1

( )
= −
′( )
+1
𝑖
𝑖
𝑖
𝑓

𝑥
𝑥
𝑥
𝑖
𝑖
𝑖
𝑓
𝑥

𝑥
𝑥
𝑖
𝑖
𝑓
𝑥
𝑓
𝑥
Numerical Methods in Chemical Engineering

Example: Use the Newton-Raphson method to estimate the root of


f(x) = e-x - x, employing an initial guess of x0 = 0.
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 −

• Modified Secant Method

( + )− ( ) ( )
′( ) ≅
𝑖
𝑖
= −
𝑖
𝑥
𝛿
𝑥
𝑥
𝑖
𝑖
𝑖
𝑖
𝑖
𝑓
𝑓
𝑥
𝑥
𝛿
𝑥
𝑓
𝑥
𝑓
𝑥
( + )− ( )
+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

• Use (a) fixed-point iteration and (b) the Newton-Raphson method to


determine a root of ( ) = − 0.9 2 + 1.7 + 2.5 using x0 = 5. Perform the
computation until ea is less than es = 0.01%.

• 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

Determine the highest real root of


3 2
( )= −6 + 11 − 6.1
• Graphically.
• Using the Newton-Raphson method (three iterations, xi = 3.5).
• Using the secant method (3 iterations, xi+1 = 2.5 and xi = 3.5).
• Using the modified secant method (3 iterations, xi = 3.5, = 0.01).
𝑓
𝑥
𝑥
𝑥
𝑥
𝛿
Numerical Methods in Chemical Engineering

Determine the real root of


3
( ) = −25 + 82 − 90 + 44 − 8 4 + 0.7 5
2

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

• Triple root: f(x) = (x - 3)(x - 1)(x - 1)(x - 1) or f(x) = x4 - 6x3 + 12x2 -


10x + 3


Numerical Methods in Chemical Engineering

• Systems of Nonlinear Equations

• Fixed-Point Iteration

• Use fixed-point iteration to determine the


roots of equation. Note that a correct pair of
roots is x = 2 and y = 3. Initiate the
computation with guesses of x = 1.5 and y =
3.5.
Numerical Methods in Chemical Engineering
Multivariable Newton-Raphson
• ( ) = 0, = 1, 2,…,

[ ]= [ ]+ ∑[ ] [ ]
( +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%

You might also like