CLL113 Notes
CLL113 Notes
METHODS
IN
CHEMICAL
ENGINEERING
CLL-‐113
Prof.
Jayati
Sarkar
(course
co-‐ordinator)
Feedback
• Email
( jayati@chemical.iitd.ac.in)
Books
Text
books:
• S.C.
Chapra
&
R.P.
Canale,
"Numerical
Methods
for
Engineers
with
Personal
Computer
Applica@ons",
McGraw
Hill
Book
Company,
1985.
• R.L.
Burden
&
J.
D.
Faires,
"Numerical
Analysis".
Reference
books:
• Atkinson,
K.E.,
"An
Introduc@on
to
Numerical
Analysis",
John
Wiley
&
Sons,
1978.
• Gupta,
S.
K.,
"Numerical
Methods
for
Engineers,
New
Academic
Science,
2012.
•
W.
H.
et
al.,
"Numerical
Recipes
in
C:
The
Art
of
Scien@fic
Compu@ng,
3rd
Edi@on,
Cambridge
University
Press,
2007.
Journals:
h[ps://www.aps.org,
h[ps://www.sciencedirect.com/
• Interna@onal
Journal
for
Numerical
Methods
in
Engineering
• Physics
of
Fluid
• Interna@onal
Journal
of
Numerical
Methods
for
Heat
&
Fluid
Flow
• Journal
of
Non-‐Newtonian
Fluid
Mechanics
Policies
• Lectures
will
be
carried
out
in
asynchronous
mode
and
ppts
with
video
lectures
will
be
uploaded
in
Impartus
in
Moodle.
• Quiz – 10 %
• Minor – 20 %
• Major – 40 %
• Term Paper-15 %
• Practical Submissions-15 %
• All exams will be closed book
Course
Outline
Numerical
What
Why?
is?
Methods
How?
Where do we need numerical methods
In Engineering
Civil, Mechanical,
chemical in all
engineering
problems
!!!
! [!] !
! = ! + [!]
!
Example
!
! ! = ! [!] − ! = 0
! ! [!]
! !!! = ! [!] − !!!!!(!"#$%&!!"#ℎ!"#!!"#ℎ!")
!! ! [!]
[!] ! [!] !
! −! ! +! 1 [!] !
= ! [!] − = = (! + [!] )
2! [!] 2! [!] 2 !
Example of Iterative Method
! ! ! !
! [!] = !
! ! +!! = !
0.1 + !.! = 0.5× 30.1 =15.05
[2]
Iteration Number ! = 2 x = 7.6247
[!] ! ! ! ! !
! = !
! +!! = !
7.6247 + !.!"#$! = 0.5× 8.018 =4.009
! !
Henon Approximation ! ::::::! !!! = ! ![!] + ![!]
0 0.1 30 15.08
1 15.05 0.199 7.6247
2 7.6247 0.393 4.009
3 4.009 0.748 2.3787
4 2.3787 1.2612 1.81997
5 1.8199 1.6484 1.73205
6 1.7341 1.72993 1.73205
7 1.73205 1.732049 1.73205
8 1.73205 1.73205 1.73205
9 1.73205 1.73205 1.73205
#
Accuracy and Precision
Accuracy: refers to how closely a computer or
measured value agrees with true value
Precision: refers to how closely individual computed or
measured values are to each other
True Value= Approximation + Error
ET = True Value – Approximation
Shortcomings
True Value - It takes no account of the order of
magnitude of the value under consideration
.
Shortcomings
Approximation - True or analytical values are rarely
available
!"##$%&!!""#$%&'!(&$) − !"#$%&'(!!""#$%&'!(&$)!
=! ×!""%
!"##$%&!!""#$%&'!(&$)
For number of terms =2 !! = !! ! − !!! = 2.718282 − 2 =0.718282
!! ! !!!! !.!"#$#$!!
For number of terms =2 !! = ! ×100 = ×100=26.424116
!! !.!"#$#$
! !
!! !!! !!!
For number of terms =2 !! = ! ×100 = ×100=50
!! !
! !
For number of terms =3 !! = !! − !! = 2.718282 − 2.5 =0.218282
! !
!! !!! !.!"#$#$!!.!
For number of terms =3 !! = ! ×100 = ×100=8.030
!! !.!"#$#$
! !
!! !!! !.!!!
For number of terms =3 !! = ! ×100 = !.!
×100=20
!!
(1)
et =2.718282+
1 1 63.2120582
2 2 26.42411641 100
3 2.5 8.030145511 40
4 2.666666667 1.898821878 12.5
5 2.708333333 0.36599097 3.076923077
6 2.716666667 0.059424789 0.613496933
7 2.718055556 0.008330425 0.102197241
8 2.718253968 0.00103123 0.01459854
&
! !
Henon Approximation ! ::::::! !!! = ! ![!] + ![!]
Sign
Number
Range
of
base
10
that
can
be
represented
on
a
16
bit
computer
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
=
214
x
1
+
213
x
1
+
212
x
1
+
211
x
1
+
210
x
1+
29
x
1
+…..+21
x
1
+
20
x
1
=
215
-‐
1
=
32767
range
is
from
-‐
32767
to
32767
Since
1000000000000000
∼
is
redundant
as
+0
&
-‐0
are
same
,
so
one
more
is
added
to
-‐ve
integer
that
is
-‐32768
to
32767.
Integer
numbers
above
and
below
this
cannot
be
stored
FLOATING POINT REPRESENTATION
Fractional values can be represented by floating point representation
m . be
where m = the mantissa, b = the base of the number system being used, and
e = the exponent
Fractional part is called mantissa or significand.
156.78 à 0.15678 x 103 For a machine that stores 7 bit
Sign of
1/34 = 0.029411765 number Magnitude
of exponent
↪︎for decimal system 10 base
0.0294 x 100
0.2941 × 10−1
1/𝑏 ≤ m < 1
Magnitude
Sign of of mantissa
In 10 base system 0.1≤m <1 exponent
In 2 base system 0.5 ≤m <1
Smallest
Number
Magnitude of mantissa
= 1×2-‐1+0×2-‐2+0×2-‐3
= 0.5
Magnitude of exponent
= 1 × 21 + 20 = 3
Exponent:
1
×
21
+
20
=
3
Magnitude:
1
×
2−1
+
0
×
2−2
+
0
×
2−3=
0.5
Number:
0.5
x
2-‐3
=
0.
0625
0111100
=
(1
×
2−1
+
0
×
2−2
+
0
×
2−3)
×
2−3
=
(0.06250)10
0111101
=
(1
×
2−1
+
0
×
2−2
+
1
×
2−3)
×
2−3
=
(0.078125)10
∆x1=
0.015625
0111110
=
(1
×
2−1
+
1
×
2−2
+
0
×
2−3)
×
2−3
=
(0.093750)10
0111111
=
(1
×
2−1
+
1
×
2−2
+
1
×
2−3)
×
2−3
=
(0.109375)10
(0.06250)10
(0.125000)10
There is a limited range of quantities that may be represented
• Large +ve and -ve quantities cannot be represented → overflow error
• In addition very small quantities near to zero cannot be represented →
underflow error
→There are Only a finite number of quantities that can be represented
within the range
∆𝑥
→The degree of precision is limited
If the value of fractional number falls here, Value it takes is that of lower one
So, error is always biased → This is called “CHOPPING OFF”.
So,
maximum
Et
is
∼(Δx)
→ Alternative is to round off the error ∆𝑥
Depending on the value it is represented as the nearest allowable number
So, maximum E is rounding off ∼(Δx/2)
The
interval
between
the
numbers
∆x
increases
as
the
number
grows
in
magnitude
→It
allows
floa3ng-‐point
representa3on
to
preserve
significant
digits
→Quan3sizing
errors
∝
magnitude
of
number
it
represents
|∆x|/|x|
<
ε
Chopping
|∆x|/|x|
<
ε/2
Round
off
error
𝜀
à
machine
epsilon
=
b(1-‐t)
(no
of
significant
digit
in
man3ssa)
→Though round off errors are important → testing convergence
• No. of significant digits carried on most computers allows most engineering
problems to be performed with more than acceptable precision
⇒ 0.3641 x 102
0.2886 x 102
0.0995 x 102
0. 9950 x 101 (Addition of zero)
→ Subtracting two close numbers 0.7641 x 103 from 0.7642 x 103
⇒ 0.7642 x 103
0.7641 x 103
0.0001 x 103
0.1000 x 100
↓
Will appear as a significant digit in subsequent computation
Multiplication
0.08754549 x 102
⇒ 0.8754549 x 101
Chopped off
0.8754 x 102 ⇒ loosing precision
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
Linear
Equations
Prof.
Jayati
Sarkar
Scalar, Vector, Matrices
Scalar: T=500°C :Magnitude 3 (2,3)
2 Element of
Vector : Magnitude and direction (velocity, acceleration) 1
Norm
Rows Column
Matrix:
No. of rows : No. of Equations
No. of Columns: No. of unknowns
C
D=1×(-‐4)-‐(2)×(-‐2)=0
D=1×(-‐4)-‐(2)×(-‐2)=0
1.999
2
1
Intersection of lines/planes/Hyper surfaces==➔concept becomes difficult as n increases
In this case there are infinite combinations that give b Can only span this
line
Poorly conditioned matrix
1
➢Direct methods
• Gauss Elimination, Gauss Jordon Elimination, Sparse method Thomas Algorithm
➢ Indirect methods/ Iterative Methods
• Jacobi, Gauss-seidel & relaxation methods
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
Linear
Equations
Prof.
Jaya*
Sarkar
General
𝑛×𝑛
system
L1 ≡ x1 − 2x2 = 1
L2 ≡ 2x1 + x2 = 7
Gauss
Elimina3on
xn=
Step
k=1
Pivoted
Element
Pivo3ng
row
k=1
#a11(0) a12(0)
......................................a1n(0) &
% (
% # (0) a21 (0)
(0)
& # (0) a21 (0) &
(0) (
%0 %a22 − (0) × a12 ( ............ %a2n − (0) × a1n ((
a11 a11
% $ ' $ '(
#b1(0) &
(1)
% # (0) a31 (0)
(0)
& # (0) a (0)
(0)
&( % (
31
A = %0 %a32 − (0) × a12 ( ............ %a3n − (0) × a1n (( (0)
$ a11 ' $ a11 '( %b(0) − a21 × b(0) (
% % 2 1 (
%. ( a11(0)
. ............ . % (
% ( % a (0)
(
% # (0) an1 (0) & # (0) an1 (0) &( b(1) = %b3(0) − 31 × b (0)
%0
(0)
%an2 − (0) × a12 ( ............ %ann − (0) × a1n ((
(0)
a11(0)
1 (
$ $ a11 ' $ a11 '' % (
%. . (
% (0) (
a
%b(0) − n1 × b(0) (
%$ n a11(0)
1
('
At
the
end
of
Step
k=1
!b1(0) $
!a11(0) (0)
a12 (0) $
.............a1n # (1) &
# & #b2 &
(1) (1)
#0 a22 .............a2n & (1) # (1) &
# b = #b3 &
(1) (1) (1) &
A = #0 a32 .............a3n & #. &
#. . ............ . & # (1) &
# (1) (1)
& #"bn &%
#"0 an2 .............ann &%
k=1
(0)
a
aij(1) = aij(0) − i1(0) × a1(0)j
a11
(0)
a
bi(1) = bi(0) − i1(0) × b1(0)
a11
Step
k=2
Pivoted
Element
Pivo3ng
row
# &
% (0) (
(0) (0)
a
k=2
% 11 a12 ......................................a1n (
%0 (1)
a22 (1)
......................................a2n (
% ( # &
% # (1) a32 (1) & # a (1) &(
(2)
A = %0 0 (1) (1) 32
%a33 − (1) × a23 ( ............ %a3n − (1) × a2n ((
(1) % (0) (
$ a22 ' $ a22 '( %b1 (
% %b2(1) (
%. . ............ . ( % (
% ( % (1) a32
(1)
(
% # (1) an2 (1)
(1)
& # (1) an2(1) &
(1) ( b = %b3 − (1) × b2(1)
(2)
k = 1, 2,....(n −1)
2
k=k
(k+1),
(k+1),
a (k−1)
aij(k ) = aij(k−1) − ik(k−1) × akj(k−1)
akk
(k−1)
a
bi(k ) = bi(k−1) − ik(k−1) × bk(k−1)
akk
Back
Subs3tu3on
At
the
end
of
Step
k=n-‐1
"a11(0) a12(0) ..............a1n(0) %
Back
subs3tu3on
$ '
$0
(1)
a22 ..............a2n ' (1)
bn(n−1)
$ (2) (2) '
xn = (n−1)
(n−1) $ 0 0 a33 ...........a3n ' ann
A =
$. . ............ . ' n
$ (n−2) (n−2)
' bi(i−1) − ∑ aij(i−1) × x j
$0 0 0....an−1n−1an−1n '
j=i+1
$0
# 0 0..............ann (n−1) '
&
xi = (i−1)
a ii
"b1(0) %
$ (1) '
$b2 ' i = ( n −1), ( n − 2 ),...1
(n−1) $ (2) '
b = $b3 '
$. '
$ (n−1) '
$#bn '&
Solu3on
by
steps
of
Gauss
Elimina3on
R3 = R3 + α 31R1 R3 = R3 + α 32 R2
0.1 −0.19
α 21 = − α 32 = −
3 7.00333
0.3
α 31 = −
3
"7.85 % "7.85 % "7.85 %
$ ' $ ' $ '
b(0) = $−19.3' ⇒ b(1) = $−19.56167' ⇒ b(2) = $−19.56167'
$#71.4 '& $#70.615 '& $#70.08929 '&
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
Linear
Equations
Pivoting,
FLOPS,
GJ,
LU
Decomposition
Prof.
Jaya*
Sarkar
Pivo%ng
Ø p
stores
current
pivot
rows
Ø Big
stores
current
pivot
element
Ø First
task
to
see
if
element
below
in
the
column
is
higher
than
the
pivot
element
Ø New
largest
element
&
its
row
number
is
stores
in
big
&
p
If the previous search ends with 𝑝≠𝑘 then switching of row required
p=
k
IF
(𝑝≠𝑘)
big=|ak,k|
FOR
(jj
=k,
n)
FOR(
ii
=k+1,
n)
{
{
dummy
=ap,jj
ap,jj=ak,jj
dummy
=|aii,k|
IF
(dummy
>
big)
ak,jj=dummy
big
=dummy
}
p=
ii
dummy
=bp
END
IF
bp=bk
}
bk
=dummy
END
IF
Pivo%ng
Ø p
stores
current
pivot
rows
Ø Big
stores
current
pivot
element
Ø First
task
to
see
if
element
below
in
the
column
is
higher
than
the
pivot
element
Ø New
largest
element
&
its
row
number
is
stores
in
big
&
p
If the previous search ends with 𝑝≠𝑘 then switching of row required
p=
k
IF
(𝑝≠𝑘)
big=|ak,k|
FOR
(jj
=k,
n)
FOR(
ii
=k+1,
n)
{
{
dummy
=ap,jj
ap,jj=ak,jj
dummy
=|aii,k|
IF
(dummy
>
big)
ak,jj=dummy
big
=dummy
}
p=
ii
dummy
=bp
END
IF
bp=bk
}
bk
=dummy
END
IF
FLOPS
involved
in
Gauss
Elimina%on
1
k
FLOPS
IN
STEP
k=1
for
Gauss
Elimina%on
#a11(0)
a12(0)
......................................a1n(0) & #b1(0) &
% ( % (
% # (0) a21(0)
(0)
& # (0) a21(0) &
(0) (
(0)
%b(0) − a21 × b(0) (
% 0 % a 22 − × a 12 ( ............ % a 2n − × a1n ( (
$ a11(0)
' $ a11(0)
' % 2 a (0) 1 (
% ( % 11
(
% # (0) a31 (0) & # (0) a31 (0) &( (1) % (0) a31 (0)
(
A = %0 %a32 − (0) × a12 ( ............ %a3n − (0) × a1n (( b = %b3 − (0) × b1(0) (
(1) (0) (0)
=
n
2
n
b (i−1)
(i-1)
i − ∑ aij(i−1) × x j
j=i+1 bn( n−1)
xi = (i−1)
, xn = ( n−1)
a ii ann
i
Back
Subs*tu*on
Mul*plica*on+
Addi*on/
Division
Subtrac*on
: : :
n-‐i i+1 i
: : :
n(n −1)
= 1+ ( n −1) +
2
n ( n +1)
=
2
1
Addi%on
+
Subtrac%on
∑ (i ) =
n(n −1)
2
i=n−1
-‐1
[y] yi = bi − ∑α ij y j
j=1
[ L ] [ y] ⇒ [b]
Forward
Subs%tu%on
[U ] [ x ] = [ y] ⇒ [ x ]
"1 0 0 0........ %" y1 % "b1 %
$ '$ ' $ ' Back
Subs%tu%on
$−α 21 1 0 0......... '$ y2 ' $b2 '
$−α 31 − α 32 1 0........ '$ y3 ' = $b3 '
$ '$ ' $ '
$−α 41 - α 42 - α 43 0........'$ y4 ' $b4 '
$#! ! ! ! '&$#! '& $#! '&Original
b
value
Varia%ons
of
Gauss
Elimina%on:
LU
Decomposi%on
[ A] [ x ] ⇒ [b]
y1 = b1
[ L ] [U ] [ x ] ⇒ [b] y2 = b2 − α 21 y1
i−1
[y] yi = bi − ∑α ij y j
j=1
[ L ] [ y] ⇒ [b]
Forward
Subs%tu%on
[U ] [ x ] = [ y] ⇒ [ x ]
"1 0 0 0........ %" y1 % "b1 %
$ '$ ' $ ' Back
Subs%tu%on
$−α 21 1 0 0......... '$ y2 ' $b2 '
$−α 31 − α 32 1 0........ '$ y3 ' = $b3 '
$ '$ ' $ '
$−α 41 - α 42 - α 43 0........'$ y4 ' $b4 '
$#! ! ! ! '&$#! '& $#! '&Original
b
value
Varia%ons
of
Gauss
Elimina%on:
LU
Decomposi%on
"3 − 0.1 - 0.2% "3 − 0.1 - 0.2 % "3 − 0.1 - 0.2 %
$ ' (1) $ ' (2) $ '
(0)
A = $0.1 7 − 0.3 ' A = $0 7.00333 − 0.29333' A = $0 7.00333 − 0.29333'
$#0.3 − 0.2 10 '& $#0 − 0.19000 10.02000'& $#0 0 10.01201 '&
/K
/K
/K
-‐ banded
diagonal
super
diagonal
!1 c1% 0 0 0 0 0 # !d1% #
2. EliminaBon
Step
' (' (
'0 b2% c2 0 0 0 0 ( 'd2% ( b2! = b2 − c1!a2
R2=R2-‐R1*a2
'0 a3 b3 c3 0 0 0 ( ' d3 (
d2! = d2 − d1!a2
!" A (1) #$, !"d (1) #$''0 0 a4 b4 c4 0 0
('
(, 'd4
(
(
'! ! ! ! ! ! ! ( '! ( 2
MulBplicaBons/Divisions
' (' (
'0 0 0 0 aN−1 bN−1 cN−1 ( 'd N−1 ( 2
AddiBons/SubtracBons
'"0 0 0 0 0 aN bN ($ '"d N ($
x i+1 y i+1
iniBal guess
0
1
2
3
Start
with
iniBal
guess
i
xi+1=x1
yi+1=x2
=x1
=x2
iniBal guess 0 0
0 3.5 1.25
1 2.875 0.9375
x (j ) − x (j
N N−1)
2
3.03125
1.015625
(N )
< εtolerance for ∀j
xj
3
2.992
0.996
4
3.001
1.009
n
a11 ≥ ∑ a1i
i=2
i≠1
n
a22 ≥ ∑ a2i
i=1
i≠2
n
aii ≥ ∑ aij
i=1
i≠ j
a22
)
2
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
non-‐Linear
Equations
Bracketing
Methods
Prof.
Jaya*
Sarkar
van
der
Waals
T0
,
CA 2.00
2.00
=0
itera2on
fl
&
fr
y− fl f r − fl (xr,fr)
l
= r
x−x x − xl
xl
xr
0− fl fr− fl (x3,f3)
i+1 l
= r l
x −x x −x (x2,f2)
x i+1 l
=x −f l ( x r
− x l
) (xl,fl)
( f r
− f l
)
l
x &x r
fl× fr <0
x i+1 l
=x −f l (x r
−x ) l
(f r
−f ) l
x l = x i+1
x r = x i+1
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
non-‐Linear
Equations
Open
Methods
Prof.
Jaya*
Sarkar
Secant
Method
f(x)=x-‐e^x/3
x^0=1
x^1=2
tol=1*10-‐4
x^(i+1)=x^i-‐f^i*(x^i-‐
Itn
x^i-‐1
x^i
f^i-‐1
f^i
x^i-‐1)/(f^i-‐f^i-‐1)
f^(i+1)
|x(i-‐1)-‐x(i+1)|
guess
x i+1 = g ( x i )
x i+1 − x i < ε tol
Fixed
Point
Itera*on
Method
f(x)=x-‐e^x/3
x^0=1
tol=1*10-‐4
g(x)=Exp(x)/3
g(x)=LN(3x)
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
0
1
0.906093943
0
1
1.098612289
1
0.906093943
0.824879185
0.093906057
1
1.098612289
1.192660116
0.098612289
2
0.824879185
0.760535032
0.081214758
2
1.192660116
1.274798493
0.094047828
3
0.760535032
0.713140191
0.064344153
3
1.274798493
1.34140041
0.082138377
4
0.713140191
0.680129473
0.047394841
4
1.34140041
1.392326439
0.066601917
5
0.680129473
0.658044437
0.033010718
5
1.392326439
1.429588334
0.050926029
6
0.658044437
0.643670808
0.022085035
6
1.429588334
1.455998813
0.037261895
7
0.643670808
0.634485097
0.014373629
7
1.455998813
1.474304423
0.026410479
8
0.634485097
0.628683586
0.009185712
8
1.474304423
1.48679859
0.01830561
9
0.628683586
0.625046831
0.005801511
9
1.48679859
1.4952375
0.012494167
10
0.625046831
0.622777817
0.003636755
10
1.4952375
1.500897346
0.00843891
11
0.622777817
0.621366327
0.002269014
11
1.500897346
1.504675448
0.005659846
12
0.621366327
0.620489894
0.00141149
12
1.504675448
1.507189515
0.003778103
13
0.620489894
0.619946314
0.000876433
13
1.507189515
1.508858957
0.002514066
14
0.619946314
0.619609416
0.00054358
14
1.508858957
1.509965996
0.001669442
15
0.619609416
0.619400705
0.000336899
15
1.509965996
1.51069942
0.001107039
16
0.619400705
0.619271443
0.00020871
16
1.51069942
1.511185024
0.000733424
17
0.619271443
0.6191914
0.000129262
17
1.511185024
1.511506416
0.000485604
18
0.6191914
0.61914184
8.0043E-‐05
18
1.511506416
1.511719069
0.000321392
19
0.61914184
0.619111156
4.956E-‐05
19
1.511719069
1.511859748
0.000212653
20
0.619111156
0.61909216
3.06839E-‐05
20
1.511859748
1.511952803
0.000140679
21
0.61909216
0.619080399
1.89965E-‐05
21
1.511952803
1.512014351
9.30548E-‐05
x i+1 − x i < ε tol
Newton
Raphson
Itera*on
Method
f(x)=x-‐e^x/3
f`(x)=1-‐e^x/3
tol
1*10^-‐4
i l
3. Stopping criteria x − x < εtol or, x − x < εtol
3.
Si+1
t
i+1
Convergence
i i i−1
E = x −x
Bisection Method
itera*on:0
itera*on:1
itera*on:2
Bisection Method
itera*on:0
itera*on:1
itera*on:2
Rate of Convergence
E i < ε tol
L
Ei = i
< ε tol
2
! L $
ln # &
ε
" tol %
i=
ln 2
Bisec*on
Method
f(x)=x-‐e^x/3
x^l=1
x^r=2
tol=1*10-‐4
x^(i+1)=0.5(x^l
Itn
x^l
x^r
f^l
f^r
+x^r)
f^(i+1)
f^l
f^(i+1)
Error
1
1
2
0.093906057
-‐0.4630187
1.5
0.006103643
0.000573169
0.5
2
1.5
2
0.006103643
-‐0.4630187
1.75
-‐0.168200892
-‐0.001026638
0.25
3
1.5
1.75
0.006103643
-‐0.168200892
1.625
-‐0.067806346
-‐0.000413866
0.125
4
1.5
1.625
0.006103643
-‐0.067806346
1.5625
-‐0.027744394
-‐0.000169342
0.0625
5
1.5
1.5625
0.006103643
-‐0.027744394
1.53125
-‐0.010067718
-‐6.14498E-‐05
0.03125
6
1.5
1.53125
0.006103643
-‐0.010067718
1.515625
-‐0.001796801
-‐1.0967E-‐05
0.015625
7
1.5
1.515625
0.006103643
-‐0.001796801
1.5078125
0.002199369
1.34242E-‐05
0.0078125
8
1.5078125
1.515625
0.002199369
-‐0.001796801
1.51171875
0.000212816
4.6806E-‐07
0.00390625
9
1.51171875
1.515625
0.000212816
-‐0.001796801
1.513671875
-‐0.000789104
-‐1.67934E-‐07
0.001953125
10
1.51171875
1.513671875
0.000212816
-‐0.000789104
1.512695313
-‐0.000287423
-‐6.11681E-‐08
0.000976563
11
1.51171875
1.512695313
0.000212816
-‐0.000287423
1.512207031
-‐3.71233E-‐05
-‐7.90042E-‐09
0.000488281
12
1.51171875
1.512207031
0.000212816
-‐3.71233E-‐05
1.511962891
8.78913E-‐05
1.87046E-‐08
0.000244141
13
1.511962891
1.512207031
8.78913E-‐05
-‐3.71233E-‐05
1.512084961
2.53953E-‐05
2.23202E-‐09
0.00012207
14
1.512084961
1.512207031
2.53953E-‐05
-‐3.71233E-‐05
1.512145996
-‐5.86119E-‐06
-‐1.48846E-‐10
6.10352E-‐05
1
itera*on
(i)
Number
of
itera*ons
required
to
reach
desired
accuracy
0
2
4
6
8
10
12
14
16
0.1
y
=
e-‐0.693x
# 1 &
Error
0.01
ln % (
$ 1×10 −4 '
0.001
i= = 13.2877 ≈ 14
ln(2)
0.0001
0.00001
g ( x ) − g ( xi )
g! (ξ ) =
( x − x i
)
( )
x i
(x )
i
xi
(i+1)
= g! (ξ ) E ( ) = α E ( ) = α 2 E i−1 = ..... = α i E 1
i i
E
0.2
0.1
0
0
0.5
1
1.5
2
2.5
-‐0.1
f(x)
-‐0.2
x
-‐0.3
-‐0.4
-‐0.5
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
0
1.52
1.524075065
0
1.0986
0.999987711
1
0.999987711
0.906082808
0.098612289
1
1.524075065
1.530298442
0.004075065
2
0.906082808
0.82487
0.093904903
2
1.530298442
1.539851762
0.006223377
3
0.82487
0.760528047
0.081212808
4
0.760528047
0.71313521
0.064341953
3
1.539851762
1.55463295
0.00955332
5
0.71313521
0.680126085
0.047392837
4
1.55463295
1.577782944
0.014781189
6
0.680126085
0.658042208
0.033009125
7
0.658042208
0.643669373
0.022083877
5
1.577782944
1.614734675
0.023149994
8
0.643669373
0.634484186
0.014372835
6
1.614734675
1.675518026
0.036951731
9
0.634484186
0.628683013
0.009185187
7
1.675518026
1.7805205
0.060783351
10
0.628683013
0.625046473
0.005801173
11
0.625046473
0.622777594
0.00363654
8
1.7805205
1.977647904
0.105002474
12
0.622777594
0.621366189
0.002268879
9
1.977647904
2.408575792
0.197127404
13
0.621366189
0.620489808
0.001411405
14
0.620489808
0.619946261
0.000876381
10
2.408575792
3.706038451
0.430927888
15
0.619946261
0.619609383
0.000543547
11
3.706038451
13.5640941
1.297462659
16
0.619609383
0.619400685
0.000336878
17
0.619400685
0.61927143
0.000208698
12
13.5640941
259232.8096
9.858055654
18
0.61927143
0.619191392
0.000129254
13
259232.8096
#NUM!
259219.2455
19
0.619191392
0.619141835
8.00382E-‐05
0.2
0.1
0
0
0.5
1
1.5
2
2.5
-‐0.1
f(x)
-‐0.2
x
-‐0.3
-‐0.4
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
-‐0.5
0
1
1.098612289
1
1.098612289
1.192660116
0.098612289
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
2
1.192660116
1.274798493
0.094047828
0
0.619
0.618962282
3
1.274798493
1.34140041
0.082138377
1
0.618962282
0.618901347
3.77176E-‐05
4
1.34140041
1.392326439
0.066601917
2
0.618901347
0.618802895
6.0935E-‐05
5
1.392326439
1.429588334
0.050926029
3
0.618802895
0.618643807
9.84519E-‐05
6
1.429588334
1.455998813
0.037261895
4
0.618643807
0.618386685
0.000159088
7
1.455998813
1.474304423
0.026410479
5
0.618386685
0.617970975
0.000257123
8
1.474304423
1.48679859
0.01830561
6
0.617970975
0.617298499
0.00041571
9
1.48679859
1.4952375
0.012494167
7
0.617298499
0.616209708
0.000672475
10
1.4952375
1.500897346
0.00843891
8
0.616209708
0.614444351
0.001088791
11
1.500897346
1.504675448
0.005659846
9
0.614444351
0.611575375
0.001765357
12
1.504675448
1.507189515
0.003778103
10
0.611575375
0.606895219
0.002868976
13
1.507189515
1.508858957
0.002514066
14
1.508858957
1.509965996
0.001669442
11
0.606895219
0.599213165
0.004680156
15
1.509965996
1.51069942
0.001107039
12
0.599213165
0.586474412
0.007682054
16
1.51069942
1.511185024
0.000733424
13
0.586474412
0.564986049
0.012738753
17
1.511185024
1.511506416
0.000485604
14
0.564986049
0.527658048
0.021488363
18
1.511506416
1.511719069
0.000321392
15
0.527658048
0.459305447
0.037328001
19
1.511719069
1.511859748
0.000212653
16
0.459305447
0.32057246
0.068352601
20
1.511859748
1.511952803
0.000140679
17
0.32057246
-‐0.039034656
0.138732987
21
1.511952803
1.512014351
9.30548E-‐05
18
-‐0.039034656
#NUM!
0.359607116
Fixed Point Iteration: Rate of Convergence
1
0
2
4
6
8
10
12
14
16
18
20
0.1
itera*on
number
(i)
g(x)=Exp(x)/3
0.01
Error(i+1)
itera*on
Number
x^i
g(x^i)
Error=|x^i1-‐x^i-‐1|
0
0.7
0.671250902
0.001
1
0.671250902
0.652227804
0.028749098
2
0.652227804
0.639937678
0.019023099
0.0001
3
0.639937678
0.632120897
0.012290125
4
0.632120897
0.627199008
0.007816781
0.00001
5
0.627199008
0.624119588
0.004921889
6
0.624119588
0.622200619
0.003079419
0.000001
y
=
0.0508e-‐0.473x
7
0.622200619
0.621007779
0.00191897
8
0.621007779
0.620267458
0.001192839
9
0.620267458
0.619808431
0.000740321
ln[E (
i+1)
10
0.619808431
0.619523988
0.000459027
] = ln[E 1 ] + i × ln α
11
0.619523988
0.619347793
0.000284444
12
0.619347793
0.619238677
0.000176195
α = g! (ξ )
13
0.619238677
0.619171112
0.000109116
14
0.619171112
0.619129279
6.75652E-‐05
≈ g! x ( )
≈ 0.6192
ln ( 0.6192 ) ≈ -0.4793
Derivation of Newton Raphson Method
i
Current guess: x
f ( x) = f ( x
( x−x ) i
i
) + (x − x i
) f "( x i
) +
2!
f "" ( x i ) +...
0 = f (x i
) + (x i+1
−x i
) f "( x ) i
x i+1
=x − i
f "( x )i
Error Estimation: Newton Raphson Method
Taylor Series of true value x 2
0 = f (x
( x−x ) i
i
) + ( x − x ) f "( x )
i i
+
2!
f "" ( x i ) +...
2
E (x i
) Mean Value Theorem
0= f ( x ) + E ( x ) f !( x ) +
i i i
2!
f !! ( x i
) + ...
2
E (x i
) xi < ξ < x
0 = f ( xi ) + E ( xi ) f !( xi ) + f !! (ξ ) (1)
2!
Newton Raphson Method
0 = f ( x i ) + ( x i+1 − x i ) f " ( x i )
0 = f ( x i ) + ( x i+1 − x + x − x i ) f " ( x i )
0 = f (x
( x−x ) i
i
) + ( x − x ) f "( x )
i i
+
2!
f "" ( x i ) +...
2
E (x i
) Mean Value Theorem
0= f ( x ) + E ( x ) f !( x ) +
i i i
2!
f !! ( x i
) + ...
2
E (x i
) xi < ξ < x
0 = f ( xi ) + E ( xi ) f !( xi ) + f !! (ξ ) (1)
2!
Newton Raphson Method
0 = f ( x i ) + ( x i+1 − x i ) f " ( x i )
0 = f ( x i ) + ( x i+1 − x + x − x i ) f " ( x i )
2
E (x i
) f "" (ξ )
E (x i+1
)=− 2! f "( xi ) xi < ξ < x
i 2
E ( x ) f ## ( x i )
E ( x i+1 ) ≈ −
2! f #( xi )
$ f ## ( x i
) '
i 2
η
E (x ) ≈ −
i+1
& ) E (x )
% 2! f # ( x ) )
i
& (
α
Rate of convergence is QUADRATIC
0.2
0.1
0
itera*on
-‐0.1
0
0.5
1
1.5
2
2.5
1
0.1
0
1
2
3
4
5
itera*on
no.
Error(i+1)
0.01
f(x)=x-‐e^x/ 0.001
0.0001
Newton
Raphson
Method
3
f`(x)=1-‐e^x/3
tol
1*10^-‐4
0.00001
0.000001
0.0000001
1E-‐08
Itn.
Error=|x^i+1-‐
No
x^i
f(x^i)
f`(x^i)
x^i+1
x^i|
0
1.2
0.093294359
-‐0.106705641
2.074315156
0.874315156
1
2.074315156
-‐0.578716129
-‐1.653031285
1.724221281
0.350093876
2
1.724221281
-‐0.14516277
-‐0.869384051
1.557249308
0.166971973
3
1.557249308
-‐0.024667085
-‐0.581916393
1.51485991
0.042389398
4
1.51485991
-‐0.001401371
-‐0.516261281
1.512145449
0.002714461
5
1.512145449
-‐5.58108E-‐06
-‐0.51215103
1.512134552
1.08973E-‐05
Convergence
Rate
of
different
Methods
1
0
2
4
6
8
10
12
14
16
Itera*on
Number
0.1
0.01
Error
(i+1)
Bisec*on
0.001
FPI
NR
0.0001
Secant
Regula
Falsi
0.00001
0.000001
0.0000001
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
non-‐Linear
Equations
NR/Multivariable
case
Prof.
Jaya*
Sarkar
Problem Areas: Newton Raphson Method
i+1 i
f (x ) i
x =x −
f "( x ) i 0.2
0.1
0
-‐0.1
0
0.5
1
1.5
2
2.5
f(x)
-‐0.2
x
-‐0.3
f(x)=x-‐e^x/ -‐0.4
-‐0.5
Newton
Raphson
Itera*on
Method
3
f`(x)=1-‐e^x/3
tol
1*10^-‐4
100
itera*on
Error=|x^i+1-‐
Number
x^i
f(x^i)
f`(x^i)
x^i+1
x^t|
itera*on
no.
Errortrue(i+1)
0
1.1
0.098611325
-‐0.001388675
72.11110792
70.59897337
1
72.11110792
-‐6.92365E+30
-‐6.92365E+30
71.11110792
69.59897337
10
Oscilla;on
around
Minima
or
Maxima
f(x)
4
41.8365
1.64268E+16
3.92643E+15
37.65285
4.18365
5
37.65285
5.72768E+15
1.52118E+15
33.887565
3.765285
6
33.887565
1.99712E+15
5.89336E+14
30.4988085
3.3887565
38
7
30.4988085
6.96352E+14
2.28321E+14
27.44892765
3.04988085
8
27.44892765
2.42803E+14
8.84562E+13
24.70403489
2.744892765
9
24.70403489
8.46601E+13
3.42698E+13
22.2336314
2.470403488
28
10
22.2336314
2.95192E+13
1.32768E+13
20.01026826
2.22336314
11
20.01026826
1.02927E+13
5.14371E+12
18.00924143
2.001026826
12
18.00924143
3.58884E+12
1.99278E+12
16.20831729
1.800924143
18
13
16.20831729
1.25135E+12
7.72043E+11
14.58748556
1.620831729
14
14.58748556
4.36319E+11
2.99105E+11
13.128737
1.458748556
8
15
13.128737
1.52135E+11
1.15879E+11
11.8158633
1.3128737
16
11.8158633
53046236849
44894084748
10.63427697
1.18158633
17
10.63427697
18496079117
17392888267
9.570849276
1.063427697
-‐2
18
9.570849276
6449184014
6738361278
8.613764348
0.957084927
0
0.5
1
1.5
2
19
20
8.613764348
7.752387914
2248691422
784070216.9
2610579222
1011391879
7.752387914
6.977149123
0.861376434
0.77523879
x
21
6.977149123
273388379.9
391833936.9
6.279434214
0.69771491
22
6.279434214
95324633.58
151804496
5.651490799
0.627943415
100
23
5.651490799
33237644.28
58812172.68
5.086341736
0.565149063
24
5.086341736
11589249.7
22785041.39
4.577707606
0.50863413
10
25
4.577707606
4040921.242
8827392.637
4.119936959
0.457770647
26
4.119936959
1408981.851
3419913.618
3.707943555
0.411993403
1
27
3.707943555
491281.3301
1324945.547
3.337149955
0.370793601
0
10
20
30
40
50
Error
28
29
3.337149955
3.003436907
171298.9439
59727.98466
513312.0965
198868.7844
3.003436907
2.703098245
0.333713047
0.300338662
0.1
itn
30
2.703098245
20825.59662
77047.13161
2.4328014
0.270296845
31
2.4328014
7261.172653
29851.07068
2.189554759
0.24324664
0.01
32
2.189554759
2531.55048
11566.50899
1.97068574
0.218869019
33
1.97068574
882.4332477
4482.872281
1.773840237
0.196845503
0.001
34
1.773840237
307.4217666
1738.723478
1.597031348
0.176808889
35
1.597031348
106.9280696
675.8043276
1.438807931
0.158223417
0.0001
36
1.438807931
37.02141119
264.2563358
1.298711343
0.140096589
37
1.298711343
12.64980151
105.1026588
1.178354716
0.120356627
0.00001
38
1.178354716
4.161315905
43.80103747
1.083349754
0.095004962
39
1.083349754
1.226829103
20.55503401
1.023664661
0.059685092
40
1.023664661
0.263505419
12.34296217
1.002316024
0.021348637
41
1.002316024
0.023403117
10.21038368
1.000023934
0.00229209
Improvements
f ( x (i ) )
x (i+1) = x (i ) −
f " ( x (i ) ) + β
f ( x (i) )
x (i+1) = x (i) − m
f " ( x (i) )
Improvements
f ( x (i ) )
x (i+1) = x (i ) −
f " ( x (i ) ) + β
f ( x (i) )
x (i+1) = x (i) − m
f " ( x (i) )
f ( x) = 0 f ( x)
Improvements
f !( x)
=0
f ( x)
1.
Modified
Equa;on
to
solve:
u ( x) = =0
f !( x)
E2(
100 )
= 0.02
E3(
100 )
tol
= 0.002
∂g1 ∂g1 ∂g1
g1 ( x ) = g1 ( x ) +(i )
∂x1
(
(i )
|x ( i ) x1 − x1 +
∂x2
) (
(i )
|x ( i ) x2 − x2 +.... + )
∂xn
(
|x ( i ) xn − xn( )
i
)
∂g1 ∂g1 ∂g1
t
x =x
1
(i+1)
1 +
∂x1
(t (i )
|x ( i ) x1 − x1 + )
∂x2
(
t (i )
)
|x ( i ) x2 − x2 +.... +
∂xn
(
|x ( i ) xnt − xn( )
i
)
∂g1 ∂g1 ∂g1
E1(
i+1)
|x ( i ) E1( ) + |x ( i ) E2( ) +.... + |x ( i ) En( )
i i i
=
∂x1 ∂x2 ∂xn
(i+1) ∂g j (i ) ∂g j (i ) ∂g j
|x ( i ) En( )
i
Ej = |x ( i ) E1 + |x ( i ) E2 +.... +
∂x1 ∂x2 ∂xn
" ∂g j ∂g j ∂g j %
$ + +... + ' |x ( i ) ≤ 1
# ∂x1 ∂x2 ∂xn &
for
j=1
to
n
∂x1
(
(i+1)
|x ( i ) x1 − x1 +(i )
)
∂x2
( (i+1)
|x ( i ) x2 − x2 +..... + )
(i )
∂xn
(
|x ( i ) xn( ) − xn( )
i+1 i
)
0
"Δx (i+1) %
$ 1 '
In
Matrix
form:
$Δx2(i+1) '
# x (i+1) − x (i) &
(
% 1 1) (
$
$ !'
'
% (i+1) i) ( $Δx (i+1) '
− fj x = %( )
(i)
# ∂f j ∂f j
.......
∂f j
& (
%
( |x ( i ) %
x 2 − x )
(
2 ( # n &
$ ∂x1 ∂x2 ∂xn ' (
% ! (
% x (i+1) − x (i) (
(
$ n )
n '
x
(i+1)
= x
(i)
( )
− J −1 f x
(i)
if
Singular
" T −1 T %
x
(i+1)
= x
(i)
− $( J J ) J ' f x
# &
(i)
( )
Improvements
" T −1 T %
x
(i+1)
= x
(i)
− $( J J + β I ) J ' f x
# &
(i)
( )
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Solution
of
non-‐Linear
Equations
Root
Finding
of
Polynomials
Prof.
Jaya*
Sarkar
Roots of Polynomial
15
30
f(x)
10
f(x)
f(x)
25
5
10
20
0
5
15
-‐4
-‐2
0
2
4
-‐5
10
x
-‐10
0
5
-‐4
-‐2
0
2
4
-‐15
x
0
x
-‐5
-‐20
-‐4
-‐2
-‐5
0
2
4
-‐10
-‐25
f (x) = x − 7x + 63 3
f (x) = x + x − 5x + 3 2
f (x) = x 3 − 3x 2 + x − 3
2
= ( x −1) ( x − 2 ) ( x + 3) = 0 = ( x −1) ( x + 3) = 0 = ( x 2 +1) ( x − 3) = 0
P3(x)
3
0.988449848
0.046599285
-‐4.068900694
0.999902397
0.011452549
10
4
0.999902397
0.00039044
-‐4.000585589
0.999999993
9.75957E-‐05
P2(x)
0
1 1 "4 3 2.33333333 1.33333333
2 2.33333333 1.77777778 7 2.07936508 0.25396825
-‐4
-‐2
0
2
4
15
3 2.07936508 0.40312421 6.23809524 2.01474211 0.06462297
-‐5
x
10
4 2.01474211 0.0739279 6.04422634 2.00251095 0.01223116
5 2.00251095 0.01256107 6.00753286 2.00042007 0.00209089
5
6 2.00042007 0.00210051 6.0012602 2.00007006 0.00035001
-‐10
0
x
7 2.00007006 0.00035028 6.00021017 2.00001168 5.8378E"05
P1(x)
10
-‐5
-‐5
0
5
-‐10
5
0
x
-‐5
0
5
-‐5
x = 1, 2, −3 Real Unique Roots P1 (x) = x + 3
Roots of Polynomial: Newton Raphson Method
i+1 i
f ( xi )
x = x −m
f "( xi )
2
( x − (a + ib))( x − (a − ib)) = x − rx − s
Q ( x ) = x 2 − rx − s
Quadra*c
Is
this
a
factor?
a0 + a1 x + a2 x 2 + a3 x 3 +......... + an x n
= ( b2 + b3 x + b4 x 2 ........ + bn x n−2 ) × ( x 2 − rx − s ) + #$b0 + b1 ( x − r )%&
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
x2 : a2 = b2 − b3r − b4 s x2 : b2 = a2 + b3r + b4 s
x1 : a1 = b1 − b2 r − b3s x1 : b1 = a1 + b2 r + b3s
x0 : a0 = b0 − b1r − b2 s x0 : b0 = a0 + b1r + b2 s
Bairstow's Method
x n : bn = an R ( x ) = b0 + b1 ( x − r )
x n−1 : bn−1 = an−1 + bn r
i
b0 ( r, s ) ⇒ 0
x : bi = ai + bi+1r + bi+2 s
......i = n - 2..to..0 b1 ( r, s ) ⇒ 0
0
∂b1 ∂b1
b1 ( r + Δr, s + Δs ) = b1 ( r, s ) + Δr + Δs
∂r ∂s
0
∂b0 ∂b0
b0 ( r + Δr, s + Δs ) = b0 ( r, s ) + Δr + Δs
∂r ∂s
" ∂b1 ∂b1 %
$ '"Δr % "−b1 ( r, s ) %
$ ∂r ∂s '
$ '=$ ' "Δr % "−b1 ( r, s ) % "Δr % "
−1 −b1 ( r, s )
%
$ ∂b0 ∂b0 '#Δs & $#−b0 ( r, s )'& [ M ]$ ' = $ ' $ ' = [M ] $ '
$# ∂r #Δs & $#−b0 ( r, s )'& #Δs & $#−b0 ( r, s )'&
∂s '&
Bairstow's Method
x n : cn = bn " ∂b1 ∂b1 %
x n−1 : cn−1 = bn−1 + cn r $ ' " %
∂s '"Δr % = $−b1 ( r, s ) '
!c2 c3 $!Δr $ !−b1 ( r, s ) $
$ ∂r $ ' # &# & = # &
x i : ci = bi + ci+1r + ci+2 s $ ∂b0 ∂b0 '#Δs & $#−b0 ( r, s )'& "c1 c2 %"Δs % #"−b0 ( r, s )&%
......i = n - 2..to..1 $# ∂r ∂s '&
c1
−b0 + b1
c2 −b1 − c3Δs r (i+1) = r (i) + Δr
Δs = , Δr =
c c2 s (i+1) = s (i) + Δs
c2 − 1 c3
c2
ε a,r =
Δr
100% Roots
r
Δs r ± r 2 + 4s
ε a,s = 100% x=
s 2
Bairstow's Method
1. Pn-‐2
is
a
third
order
polynomial
or
greater.
Bairstow's
method
is
repeated
for
the
quoEent
for
finding
new
values
of
r
and
s.
2.
The
quoEent
is
quadraEc.
Roots
can
be
evaluated
directly.
x=
2
r ± r + 4s
2
3.
The
quoEent
is
first
order
polynomial,
the
remaining
single
root
can
be
evaluated
as
x = −r / s
P5 (x) = x 5 − 3.5x 4 + 2.75x 3 + 2.125x 2 − 3.875x +1.25
P5(x)
a5
a4
a3
a2
a1
a0
1
-‐3.5
2.75
2.125
-‐3.875
1.25
8
P5(x)
6
4
2
Real
Roots:
0
x1=-‐1,
-‐1.5
-‐1
-‐0.5
-‐2
0
0.5
1
1.5
2
2.5
x
3
x2=0.5
-‐4
x3=2
-‐6
-‐8
b5 = a5
P5 (x) = x 5 − 3.5x 4 + 2.75x 3 + 2.125x 2 − 3.875x +1.25 b4 = a4 + b5r
P5(x)
a5
a4
a3
a2
a1
a0
1
-‐3.5
2.75
2.125
-‐3.875
1.25
b3 = a3 + b4 r + b5 s
b2 = a2 + b3r + b4 s
itn
r
s
b5
b4
b3
b2
b1
b0
1
-‐1.00
-‐1.00
1.00
-‐4.50
6.25
0.38
-‐10.50
11.38
b1 = a1 + b2 r + b3s
2
-‐0.64
0.14
1.00
-‐4.14
5.56
-‐2.03
-‐1.80
2.13
3
-‐0.51
0.47
1.00
-‐4.01
5.27
-‐2.45
-‐0.15
0.17
b0 = a0 + b1r + b2 s
4
-‐0.50
0.50
1.00
-‐4.00
5.25
-‐2.50
0.00
0.00
5
-‐0.50
0.50
1.00
-‐4.00
5.25
-‐2.50
0.00
0.00
c5 = b5
6
-‐0.50
0.50
1.00
-‐4.00
5.25
-‐2.50
0.00
0.00
c4 = b4 + c5r
itn
c5
c4
c3
c2
c1
c3 = b3 + c4 r + c5 s
1
1.00
-‐5.50
10.75
-‐4.88
-‐16.38
2
1.00
-‐4.79
8.78
-‐8.34
4.79
c2 = b2 + c3r + c4 s
3
1.00
-‐4.52
8.05
-‐8.69
8.08
4
1.00
-‐4.50
8.00
-‐8.75
8.37
c1 = b1 + c2 r + c3s
5
1.00
-‐4.50
8.00
-‐8.75
8.38
6
1.00
-‐4.50
8.00
-‐8.75
8.38
c1
dels
delr
Errs=
Err_r
−b0 + b1
c2 −b1 − c3Δs
1.138109017
0.35583014
824.0656852
55.23855773
Δs = , Δr =
0.331624608
0.133056764
70.5984393
26.03274392
c1 c2
0.030468695
0.011426623
6.091274153
2.286758475
c2 − c3
-‐0.00020233
-‐0.000313592
0.040466059
0.062718311
c2
1.03876E-‐08
6.52645E-‐08
2.07753E-‐06
1.30529E-‐05
-‐1.67709E-‐14
-‐1.08671E-‐14
#DIV/0!
#DIV/0!
(
x = −0.5 ± −0.5 + 4 × 0.5 2
) 2 x1 = 0.5, x2 = −1 (
x = r ± r 2 + 4s ) 2
2 3 b5
b4
b3
b2
P3 ( x ) = b2 + b3 x + b4 x + b5 x 1.00
-‐4.00
5.25
-‐2.50
P3(x)
a3
a2
a1
a0
1
-‐4
5.25
-‐2.5
P3(x)
2
0
-‐2
-‐1
0
1
2
3
-‐2
x
Real
Roots:
-‐4
x1=-‐1,
-‐6
x2=0.5
-‐8
-‐10
x3=2
-‐12
-‐14
-‐16
-‐18
P3 ( x ) = b2 + b3 x + b4 x 2 + b5 x 3 P3 (x) = x 3 − 4x 2 + 5.25x − 2.5
b3 = a3
P3(x)
a3
a2
a1
a0
1
-‐4
5.25
-‐2.5
b2 = a2 + b3r
itn
r
s
b3
b2
b1
b0
c3
c2
c1
dels
delr
Errs=
Err_r
b1 = a1 + b2 r + b3s
1
0.00
5.00
1.00
-‐4.00
10.25
-‐22.50
1.00
-‐4.00
15.25
88.42
24.67
3.584459459
0.264049955
2
24.67
93.42
1.00
20.67
608.44
16936.41
1.00
45.33
1820.08
1445.09
-‐45.30
-‐70.04163723
-‐0.029443207
b0 = a0 + b1r + b2 s
3
-‐20.63
1538.50
1.00
-‐24.63
2051.95
-‐80234.30
1.00
-‐45.26
4524.33
-‐2283.16
-‐5.11
88.70166669
0.006859424
4
-‐25.74
-‐744.65
1.00
-‐29.74
26.09
21471.67
1.00
-‐55.48
709.46
510.76
9.68
-‐31.79737754
-‐0.041372997
c3 = b3
5
-‐16.06
-‐233.89
1.00
-‐20.06
93.64
3185.91
1.00
-‐36.13
440.05
180.68
7.59
-‐21.33269308
-‐0.142716826
c2 = b2 + c3r
6
-‐8.47
-‐53.21
1.00
-‐12.47
57.66
172.60
1.00
-‐20.94
181.80
54.93
5.38
-‐17.75781197
3.126486167
c1 = b1 + c2 r + c3s
7
-‐3.09
1.72
1.00
-‐7.09
28.91
-‐104.11
1.00
-‐10.19
62.13
17.68
4.57
11.94047118
0.235791492
8 1.48 19.40 1.00 -‐2.52 20.92 -‐20.41 1.00 -‐1.04 38.77 -‐20.95 -‐0.04 -‐14.49929367 0.022664987
9 1.45 -‐1.56 1.00 -‐2.55 0.00 1.48 1.00 -‐1.11 -‐3.16 0.37 0.34 0.209251221 -‐0.284808763
10 1.78 -‐1.18 1.00 -‐2.22 0.11 0.33 1.00 -‐0.44 -‐1.85 -‐0.03 0.19 -‐0.016737978 -‐0.152346768
11
1.97
-‐1.22
1.00
-‐2.03
0.03
0.04
1.00
-‐0.06
-‐1.31
-‐0.03
0.03
-‐0.01612642
-‐0.025990154
c1
−b0 + b1
12
2.00
-‐1.25
1.00
-‐2.00
0.00
0.00
1.00
0.00
-‐1.25
0.00
0.00
-‐0.000526834
3.52232E-‐05
c2 −b1 − c3Δs
13
2.00
-‐1.25
1.00
-‐2.00
0.00
0.00
1.00
0.00
-‐1.25
0.00
0.00
-‐9.69272E-‐10
-‐6.18632E-‐08
Δs = , Δr =
c1 c2
c2 − c3
c2
(
x = 2 ± 2 2 − 4 ×1.25 ) 2 x3 = (1+ 0.5i), x4 = (1− 0.5i)
P1 ( x ) = b2 + b3 x x5 = −b2 b3 = 2
(
x = r ± r 2 + 4s ) 2
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Regression
Analysis
and
Curve
Fitting
Least
Square
Method
Prof.
Jaya*
Sarkar
Curve Fitting
ü Data is given at discrete values along a continuum
• Growth rate as a function of concentration:
C
0.5
0.8
1.5
2.5
4
X
1.1
2.4
5.3
7.6
8.9
𝑓(𝑥)
𝑓(𝑥)
𝑓(𝑥)
𝑥
𝑥
𝑥
Did not attempt to connect Used straight line segments or
the points but characterizes linear interpolation to connect the Captures meandering
general upward trend . points. Fails when the underlying suggested by data
Curve fitting which does this curve is highly curve linear or data
is called ‘Regression’ is widely placed
𝑓(𝑥)
𝑓(𝑥)
𝑥 𝑥
Model: y=ao+a1 x
Predicted:
Inadequate Criteria
Best fit line
p a s s e s
through two
points
y
3.0
2.0
Data
a1
a0
1.0
Predicted
0.0
0.8393
0.0714
0
2
4
6
8
x
Quantification of Error of Linear Regression
Standard Variation for the Regression Line
Sy =
St
=
( y − y)
i
N −1 N −1
r: Correlation Coefficient
Qua*fica*on
of
Errors
No
of
Data
Point
x
i
y
i
ypredicted
(yi-‐ybar)2
(yi-‐ypredicted)2
Standard Error of the Estimate
Point
x
i
y
i
y2
i
x
I
y
i
xpredicted
1
1
0.5
0.25
0.50
0.97
5.5
2
2
2.5
6.25
5.00
3.04
4.5
3
3
2.0
4.00
6.00
2.52
3.5
y
4
4
4.0
16.00
16.00
4.59
2.5
Data
5
5
3.5
12.25
17.50
4.07
1.5
y-‐Predicted
6
6
6.0
36.00
36.00
6.66
x-‐Predicted
0.5
7
7
5.5
30.25
38.50
6.14
28
24
105
119.5
-‐0.5
0
2
4
6
8
6.5
x
6.5
5.5
5.5
4.5
4.5
3.5
3.5
y
y
2.5
Data
2.5
1.5
1.5
Data
y-‐Predicted
0.5
0.5
x-‐Predicted
-‐0.5
0
1
2
3
4
5
6
7
8
-‐0.5
0
2
4
6
8
x
x
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Regression
Analysis
and
Curve
Fitting
Multi-‐linear
Regression
y
2.5
Data
1.5
y-‐Predicted
0.5
x-‐Predicted
-‐0.5
0
2
4
6
8
x
6.5
6.5
5.5
5.5
4.5
4.5
3.5
3.5
y
y
2.5
Data
2.5
1.5
1.5
Data
y-‐Predicted
0.5
0.5
x-‐Predicted
-‐0.5
0
1
2
3
4
5
6
7
8
-‐0.5
0
2
4
6
8
x
x
Polymer( Water( Compressive, Flexural,
cement,ratio, cement,ratio, Strength, Strength, 40.00-‐60.00
(x1) (x2) (MPa),(y1) (MPa)(y2)
20.00-‐40.00
Pure,cemet,mortar 0 0.4 50.63 7.39
50/50(5 5 0.4 45.31 8.59 60.00
0.00-‐20.00
50/50(10 10 0.4 35.63 9.30
50/50(15 15 0.4 22.21 7.30 Compress
50/50(20 20 0.4 27.18 6.40 ive
40.00
Pure,cemet,mortar 0 0.5 42.40 7.11 Strength
50/50(5 5 0.5 27.87 7.37 (MPa)
20.00
50/50(10 10 0.5 26.30 6.90
50/50(15 15 0.5 29.60 6.70
50/50(20 20 0.5 24.27 5.10 0.00
0
5
Flexural
Strength
8.00-‐10.00
10
10.00
0.5
(MPa)
6.00-‐8.00
8.00
4.00-‐6.00
15
6.00
4.00
20
0.4
2.00
0.00
0
5
Polymer
10
0.5
Cement
15
Water-‐
Ra*o
20
0.4
Cement
Ra*o
Solve
by
Gauss
EliminaHon/Gauss
Seidel
Method
=
Polymer-‐ Water-‐ Compressiv "N
cement
raHo
cement
e
Strength
$
∑ x ∑u %'"a % "$∑ y
i i
0
i
%
'
$ '
(x)
raHo
(u)
(MPa)
(y)
x2
u2
xu
yx
yu
$∑ x ∑ x x ∑u x ''$a ' = $$∑ y x '
$ i i i i i 1 i i
'
Pure
cemet
mortar
0
0.4
50.63
0
0.16
0
0
20.252
$ '
$∑ u
# i ∑ x u ∑u u '&#a & $#∑ y u
i i i i
2
i i
'
&
50/50-‐5
5
0.4
45.31
25
0.16
2
226.55
18.124
50/50-‐10
10
0.4
35.63
100
0.16
4
356.3
14.252
50/50-‐15
15
0.4
22.21
225
0.16
6
333.15
8.884
!10 100 4.5$!a0 $ !331.4 $
20
400
0.16
8
543.6
10.872
# &# & # &
50/50-‐20
0.4
27.18
# 100 1500 45 a
&# 1 & #= 2791.35 &
Pure
cemet
mortar
0
0.5
42.40
0
0.25
0
0
21.2
#"4.5 45 2.05 &%#"a2 &% #"147.6 &%
50/50-‐5
5
0.5
27.87
25
0.25
2.5
139.35
13.935
50/50-‐10
10
0.5
26.30
100
0.25
5
263
13.15
!a0 $ !71.1333 $
50/50-‐15
15
0.5
29.60
225
0.25
7.5
444
14.8
# & # &
50/50-‐20
20
0.5
24.27
400
0.25
10
485.4
12.135
#a1 & = #−1.0453 &
#"a2 &% #"−61.200 &%
N=10
100
4.5
331.4
1500
2.05
45.00
2791.35
147.60
y = 71.1333−1.0453x − 61.200u
Actual
40.00-‐60.00
60.00
20.00-‐40.00
u\x
0
5
10
15
20
40.00
y
20.00
0.00-‐20.00
0.4
50.63
45.31
35.63
22.21
27.18
0.00
0
0.5
42.40
27.87
26.30
29.60
24.27
5
10
0.5
Predicted
x
15
u
20
0.4
u\x
0
5
10
15
20
0.4
46.65
41.43
36.20
30.97
25.75
60.00
0.5
40.53
35.31
30.08
24.85
19.63
40.00
y
20.00
40.00-‐60.00
0.00
0
20.00-‐40.00
5
0.00-‐20.00
y = 71.1333−1.0453x − 61.200u
x
10
0.5
15
u
20
0.4
No
of
!e1 $ !1 1 $ !0.5 $
Data
# & # & # &
Point
x
i
y
i
#e2 & #1 2 & #2.5 &
#e3 & #1 3 & #2.0 &
1
1
0.5
# & # &!a0 $ # &
2
2
2.5
#e4 & + #1 4 &# & = # 4.0
a &
#e & #1 &" 1% #3.5 &
3
3
2.0
5 5
4
4
4.0
# & # & # &
#e6 & #1 6 & #6.0 &
5
5
3.5
#"e &% #"1 7 &% #"5.5 &%
6
6
6.0
7
7
7
5.5
e + XΦ = Y
28
24
a1
a0
0.8393
0.0714
!e1 $
# &
#e2 &
+ #e3 &
# &
#! &
#
"e N &
%
Y = XΦ + e
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Regression
Analysis
and
Curve
Fitting
Functional
and
non-‐linear
Regression
Y = XΦ + e
Φ
N
Standard
Error
used
Functional Regression
Exponential Model
Lineariza1on
ln ( y) = ln (α1 ) + β1 x
Y = a0 + a1 x
Example:
Popula1on
growth,
Radioac1vity
Decrease,
Arrhenius
Law
Power Law Model
Lineariza1on
ln ( y) = ln (α 2 ) + β2 ln ( x )
Y = a0 + a1 X
n−1
µ = mγ
Example:
non-‐Newtonian
fluid
flow
Y = a0 + a1 X
Saturation Growth Rate
Lineariza1on
1 1 1
= + β3
y α3 x
Y = a0 + a1 X
−1
Φ = (X X) X Y
T T
Pressure
a2=-‐8.14375E-‐05
0.2000
−1
a3=2.67604E-‐06
Φ=X Y 0.1500
a4=-‐3.39063E-‐08
0.1000
a5=1.71354E-‐10
0.0500
0.0000
Y = a0 + a1 x + a2 x 2 + a3 x 3 + a4 x 4 + a5 x 5 0
20
40
60
Temp
80
100
120
Newton`s Divided-Difference
Interpolating Polynomials
Linear Interpolation
The
simplest
form
of
interpola&on
is
to
connect
two
data
points
with
a
straight
line.
Using
similar
triangles
f1 ( x ) − f ( x0 ) f ( x1 ) − f ( x0 )
=
x − x0 x1 − x0
finite-‐divided-‐difference
f ( x1 ) − f ( x0 )
f1 ( x ) = f ( x0 ) + ( x − x0 )
( x1 − x0 )
Newton`s Divided-Difference
Interpolating Polynomials
Linear Interpolation f ( x1 ) − f ( x0 )
f1 ( x ) = f ( x0 ) + ( x − x0 )
( x1 − x0 )
X
y=ln(x)
Series1
Series1:
Series2:
X
f1(x)
f1(x)
2.00
1
0.00
x0
x1
1
0.00
0.00
2
0.69
1
6.00
2
0.36
0.46
1.50
3
1.10
f(x0)
f(x1)
3
0.72
0.92
0
1.79
Series-‐1
f(x)
4
1.39
4
1.08
1.39
1.00
Series2
5
1.61
5
1.43
1.85
Data
x0
x1
6
1.79
1
6
1.79
2.31
0.50
4.00
Series-‐2
f(x0)
f(x1)
Error(2)
0.00
0
1.39
Series1
48.30
0
5
10
Series2
33.33
x
Newton`s Divided-Difference
Interpolating Polynomials
Quadratic
If
three
data
points
are
available,
this
can
be
accomplished
Interpolation with
a
second-‐order
polynomial
(also
called
a
quadra&c
polynomial
or
a
parabola
).
f2 ( x ) = b0 + b1 ( x − x0 ) + b2 ( x − x0 ) ( x − x1 ) a0 = b0 − b1 x0 + b2 x0 x1
2
= b0 + b1 x − b1 x0 + b2 x + b2 x0 x1 − b2 xx0 − b2 xx1 a1 = b1 − b2 x0 − b2 x1
a2 = b2
f2 ( x ) = a0 + a1 x + a2 x 2
Newton`s Divided-Difference
Interpolating Polynomials
Quadratic
Interpolation f2 ( x ) = b0 + b1 ( x − x0 ) + b2 ( x − x0 ) ( x − x1 )
b0 = f ( x0 )
Linear Interpolation
f ( x1 ) − f ( x0 )
b1 =
( x1 − x0 )
f ( x2 ) − f ( x1 ) f ( x1 ) − f ( x0 )
−
b2 =
( x2 − x1 ) ( x1 − x0 )
Second Order Curvature
( x2 − x0 )
Newton`s Divided-Difference Interpolating Polynomials
Quadratic f2 ( x ) = b0 + b1 ( x − x0 ) + b2 ( x − x0 ) ( x − x1 )
Interpolation
x0
x1
x2
1
4
6
b0
0.00
b0 = f ( x0 )
Error(2)
f(x0)
f(x1)
f(x2)
b1
0.46
Series1
18.32
0
1.39
1.79
b2
-‐0.05
f ( x1 ) − f ( x0 )
b1 =
( x1 − x0 ) 2.00
Series1:
f2(x)
f ( x1 ) − f ( x0 ) X
y=ln(x)
1.50
f ( x2 ) − f ( x1 )
− 1
0.00
0.00
f(x)
( x2 − x1 ) ( x1 − x0 ) 1.00
Data
b2 = 2
0.69
0.57
( x2 − x0 ) 3
1.10
1.03
0.50
Series-‐1
4
1.39
1.39
0.00
5
1.61
1.64
0
2
4
6
8
6
1.79
1.79
x
Newton`s Divided-Difference
Interpolating Polynomials
General
Interpolating fn ( x ) = b0 + b1 ( x − x0 ) +... + bn ( x − x0 ) ( x − x1 ).... ( x − xn−1 )
Polynomial f (x ) − f x
First
finite
divided
difference
f !" xi , x j #$ =
i ( ) j
b0 = f ( x0 )
(x − x )
i j
b1 = f [ x1, x0 ]
Second
finite
divided
difference
f !" xi , x j #$ − f !" x j , xk #$
b2 = f [ x2 , x1, x0 ] f !" xi , x j , xk #$ =
( xi − x k )
!
nth
finite
divided
difference
bn = f [ xn , xn−1,...., x1, x0 ] f [ xn , xn−1,...., x1 ] − f [ xn−1,...., x1, x0 ]
f [ xn , xn−1,...., x1, x0 ] =
( xn − x0 )
Newton`s Divided-Difference Interpolating Polynomials
fn ( x ) = b0 + b1 ( x − x0 ) + b2 ( x − x0 ) ( x − x1 ) + b3 ( x − x0 ) ( x − x1 ) ( x − x2 )
Cubic
Interpolating i
xi
f(xi)
First
Second
Third
Polynomial 0
x0
f(x0)
f[x1,x0]
f[x2,x1,x0]
f[x3,x2,x1,x0]
1
x1
f(x1)
f[x2,x1]
f[x3,x2,x1]
2
x2
f(x2)
f[x3,x2]
3 x3 f(x3)
f(x)
5
1.61
1.61
1.0
Series1
6
1.79
1.79
0.5
Series2
0.0
Error(2)
0
2
4
6
8
Series1
9.29
x
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Curve
Fitting
Lagrange
Polynomial
and
Newtons
Divided
Difference
Formula
X
y=ln(x)
f3(x)
1
0.00
0.00
2
0.69
0.63
3
1.10
1.08
4
1.39
1.39
5
1.61
1.61
6
1.79
1.79
2
n n n
n n
n-‐1
1
Lagrange Interpolation
(1, 0) ( 4,1.386294)
P1 (x) =
( x − x 2 ) ( x − x3 )
, P2 (x) =
( x − x1 ) ( x − x3 )
, P3 (x) =
( x − x1 ) ( x − x2 )
( x1 − x2 ) ( x1 − x3 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x1 ) ( x3 − x2 )
f2 ( 2 ) = y1P1 (2) + y2 P2 (2) + y3 P3 (2)
P1 (2) =
( 2 − 4) ( 2 − 6 )
, P2 (2) =
( 2 −1) ( 2 − 6 )
, P3 (2) =
( 2 −1) ( 2 − 4)
(1− 4) (1− 6) ( 4 −1) ( 4 − 6) (6 −1) (6 − 4)
f2 ( 2 ) = 0 × 0.533+1.386295 × 0.666 +1.79176 × (−0.2 ) = 0.565
Derivation of Lagrange Polynomial from
Newton Divided Difference Formula
( x1, y1 ) ( x2 , y2 ) f ( x1 ) − f ( x2 ) f ( x1 ) f ( x2 )
f [ x1, x2 ] = = +
( x1 − x2 ) ( x1 − x2 ) ( x2 − x1 )
f1 ( x ) = f ( x1 ) + f [ x1, x2 ] ( x − x1 )
" f (x ) f ( x ) %
1 2
= f ( x1 ) + $$ + '' ( x − x1 )
# ( x1 − x2 ) ( x2 − x1 ) &
= f ( x1 ) ×
( x − x2 )
+ f ( x2 ) ×
( x − x1 )
( x1 − x2 ) ( x2 − x1 )
= y1 × P1 ( x ) + y2 × P2 ( x )
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Curve
Fitting
Numerical
Differentiation
xi x i+1
Differentiation FD
xi x i+1
BD
x i-1 x i
CD
x i-1 x i x i+1
+
(Backward Difference)
=
undetermined
coefficients:
3
point
difference
formula
Truncation Error
2 3
Δx
Error 3
=
(Δx)
f """ (xi )[a1 − a3 ]
3!
2
≈
(Δx)
f ### (xi )
3!
+
Error
Error
−1 2 3
a3 = a2 = a1 = −
2Δx Δx 2Δx
Comparisons
fi+1 − fi Δx ##
Forward
Difference: f !(xi ) = − fi (ξ )
Δx 2!
2
Central
Difference: fi+1 − fi−1 (Δx) !!!
f !(xi ) = − fi (ξ )
2Δx 3!
3
Pt
FWD
Difference: 2
−3 fi + 4 fi+1 − fi+2 (Δx) !!!
f !(xi ) = − fi (ξ )
2Δx 3
4 3 2
f (x) = −0.1x − 0.15x − 0.5x − 0.25x +1.2
f !(x) = −0.4x3 − 0.45x2 − x − 0.25 = −0.9125@x = 0.5
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Numerical
Differentiation
1.00E-‐05
1.00E-‐06 FWD
1.00E-‐07
CD
3Pt
1.00E-‐08
1.00E-‐09
1.00E-‐10
4
1.00E+01
4
1.00E-‐01
1.00E-‐03
Error
4
1.00E-‐05
1.00E-‐07
1.00E-‐09
1.0E-‐10 1.0E-‐07 1.0E-‐04
delx
1.00E-‐01
1.00E-‐02
1.00E-‐03
1.00E-‐04
1.00E-‐05
Error
1.00E-‐06
1.00E-‐07
1.00E-‐08
1.00E-‐09
1.00E-‐10
delx
8
Summary
minimum
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Numerical
Integration
Newton
Cotes
Formula
xN
Newton's Forward Difference Method (Curve
Fitting)
-‐
Newton's Forward Difference Method (Curve
Fitting)
2
4. α = 3
Δ 3 y1 = Δ (Δ 2 y1 )
3
y4 = b0 + 3b1 + 3.2b2 + 3.2.1b3 Δ y1
1
b3 = = Δ (Δ (Δy1 ))
b3 = (y4 − b0 − 3b1 − 6b2 ) 3! = Δ (Δ (y2 − y1 ))
6
1% 1 2 ( = Δ (Δy2 − Δy1 )
= ' y4 − y1 − 3 (Δy1 ) − 6 × (Δ y1 )*
6& 2! )
= Δ ((y3 − y2 ) − (y2 − y1 ))
1% 1 (
= ' y4 − y1 − 3 (y2 − y1 ) − 6 × (y3 − 2y2 + y1 )* = Δy3 − 2Δy2 + Δy1
3! & 2! )
= (y4 − y3 ) − 2 (y3 − y2 ) + (y2 − y1 )
1
= (y4 − 3y3 + 3y2 − y1 ) = y4 − 3y3 + 3y2 − y1
Newton's Forward Difference Method (Curve
Fitting)
2
2 3 i
b1 = y1 Δ y1 Δ y1 Δ y1
b2 = b3 = bi =
2! 3! i!
Δ 2 y1 Δ N−1 y1
P (α ) = y1 + Δy1α + α (α −1) +..... + α (α −1).. (α − (N − 2 ))
2! (N −1)!
Integration-Applications
1 b
• To calculate the mean: = ∫ f (x)dx
b− a a
• Mass flow:
truncation error
x1 x2
h
Geometric Interpretation of Integration
• Newton Cotes Integration Formula:
truncation error
x1 x2
h
Trapezoidal Rule:
1
I = ( f (x1 )+ f (x2 ))(x2 − x1 )
2
truncation error
x1 x2
h
Trapezoidal Rule:
x1 x2
h
Newton's Forward Difference Method
Δ 2 y1 Δ N−1 y1
y (α ) = y1 + Δy1α + α (α −1) +..... + α (α −1).. (α − (N − 2 ))
2! (N −1)!
2!
Δ 2 y1 = Δ (Δy1 )
= Δ (y2 − y1 )
= (Δy2 − Δy1 )
= ((y3 − y2 ) − (y2 − y1 ))
= y3 − 2y2 + y1
x1 x2
h
Trapezoidal
Rule Error
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Numerical
Integration
Newton
Cotes
Formula
1
I = ( f (x1 )+ f (x2 ))(x2 − x1 )
2
truncation error
x1 x2
h
Simpsons 1/3rd and 3/8th Rule
a b a b
x1 x2 x3 x1 x2 x3 x4
h = (b − a) 2
h = (b − a) 3
2
Δ y1 Δ 2 y1 Δ 3 y1
y (α ) = y1 + Δy1α + α (α −1) y (α ) = y1 + Δy1α + α (α −1) + α (α −1)(α − 2 )
2! 2! 3!
h3 f """ (ξ ) h4 f iv (ξ )
E (α ) = α (α −1)(α − 2 ) E (α ) = α (α −1)(α − 2 )(α − 3)
3! 4!
Simpsons 1/3rd Rule
h=
(b − a)
2
x : x1 → x3 x3 2
α :0 → 2
∫ ydx → ∫ yhdα
x1 0
a b
x1 h x2 h x3
I
Simpsons 3/8th Rule
h=
(b − a)
3
x4 3
x : x1 → x4
∫ ydx → ∫ yhdα
α :0 →3 x1 0
a b
x1 x2 x3 x4
I =
∫ (α 4
− 6α 3 +11α 2 − 6α )dα
24 × 30 x1 x2 x3 x4
4! 0
3h5 f iv (ξ ) 3h5 f iv (ξ )
=− −
3 80
=
h5 f iv (ξ )$α 5 3α 4 11α 3
& − + − 3α 2
'
)
E
= 80
4! % 5 2 3 (0 5
(b − a) f iv (ξ )
−
=
h5 f iv (ξ )$ 35 35 11× 33
− + − 33
' 6480
& )
4! % 5 2 3 ( Simpsons 3/8th Rule
Error in Simpsons 1/3 rd Rule
h=
(b − a)
2
x : x1 → x3 x3 2
α :0 → 2
∫ ydx → ∫ yhdα
x1 0
a b
2
h4 f """ (ξ ) 2
h5 f iv (ξ ) x1 x2 x3
E (α ) = ∫ α (α −1)(α − 2 )dα + ∫ α (α −1)(α − 2 )(α − 3)dα
0 3! 0 4!
h h
h4 f !!! (ξ ) 2
3 h5 f iv (ξ ) 2
= ∫ (α − 3α 2 + 2α )dα + ∫ (α 4
− 6α 3 +11α 2 − 6α )dα
3! 0 4! 0
h5 f iv (ξ )
4 2 5 2 E =−
90
4 iv 5
h f !!! (ξ )% α 3 2
( h f (ξ ) % α 3 4 11 3 2
(
= ' −α +α * + ' − α + α − 3α *
3! & 4 )0 4! & 5 2 3 )0
5iv
=
4
h f !!! (ξ )$ 2
− 2 3
+
4
2 2
' h f (ξ )$ 2
+ −
3
5
× 2
iv
4
+
11
× 2 3
− 3×
5
2 2
'
=−
(b − a) f (ξ)
& ) & )
3! % 4 ( 4! % 5 2 3 ( 2880
h5 f iv (ξ ) # 32 88 & h5 f iv (ξ )
=0+ % − 24 + −12 ( = −
4! $ 5 3 ' 90
Repeated use of Trapezoidal Rule
xN+1
I= ∫ ydx
x1
h!" f (x1 ) + f (x2 )#$ h!" f (x2 ) + f (x3 )#$ h!" f (x3 ) + f (x4 )#$
= + + +...
2 2 2
h!" f (xN−1 ) + f (xN )#$ h!" f (xN ) + f (xN+1 )#$
+ +
2 2
Repeated use of Trapezoidal Rule
xN+1
I= ∫ ydx =−
3
(Δx) f # (ξ )
x1 12
h!" f (x1 ) + f (x2 )#$ h!" f (x2 ) + f (x3 )#$ h!" f (x3 ) + f (x4 )#$
= + + +...
2 2 2
h!" f (xN−1 ) + f (xN )#$ h!" f (xN ) + f (xN+1 )#$
+ +
2 2
" N %
# f (x1 ) + 2∑ f (xi ) + f (xN+1 )&
$ i=2 '
=h
2
# N &
$ f (x1 ) + 2∑ f (xi ) + f (xN+1 )'
% i=2 ( 1
= (b − a) 3
2N (b − a) 1
=− N × f ## ∝ 2
WIDTH AVERAGE
HEIGHT 12N 3 N
Repeated use of Simpson`s 1/3rd Rule
xN+1 x3 x5 xN+1
I= ∫ ydx = ∫ ydx + ∫ ydx +... + ∫ ydx
x1 x1 x3 xN−1
h!" f (x1 ) + 4 f (x2 ) + f (x3 )#$ h!" f (x3 ) + 4 f (x4 ) + f (x5 )#$ h!" f (x5 ) + 4 f (x6 ) + f (x7 )#$
= + + +... 5
3 3 3 (Δx) f iv (ξ )
=−
h!" f (xN−3 ) + 4 f (xN−2 ) + f (xN−1 )#$ h!" f (xN−1 ) + 4 f (xN ) + f (xN+1 )#$ 90
+ +
3 3
h# N N−1 &
= % f (x1 ) + 4 ∑ f (xi ) + 2 ∑ f (xi ) + f (xN+1 )(
3$ i=2,4,6 i=1,3,5 '
5 N /2
( b − a)
# N N−1 & Error = −
90N 5
∑ (ξi )
f iV
=−
( b − a) N × f iV ∝ 1
80N 5 N4
3 $ N −1 N N −2 '
= (b − a) × & f ( x1 ) + 3 ∑ f ( xi ) + 3 ∑ f ( xi ) + 2 ∑ f ( xi ) + f ( x N+1 ))
8N % i=2,5,8,.. i=3,6,9.. i=4,7,10... ( 11
AVERAGE&HEIGHT&
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Numerical
Integration
Newton
Cotes
Formula:
Worked
Out
Examples
3
0.8
I= ∫ f (x) dx
f(x)
2
0
1
0
0 0.2 0.4 0.6 0.8
Analytical Solution: x
0.8
25 2 200 3 675 4 900 5 400 6
I = 0.2x + x − x + x − x + x
2 3 4 5 6 0
I = 1.6405333
Trapezoidal Rule
Analytical Solution: 1.6405333
Single Domain, N=1
h = 0.8
h
I = ( f (x1 ) + f (x2 ))
2
h
= ( f (0 ) + f (0.8))
2
0.8
= (0.2 + 0.232)
2
= 0.1728
Trapezoidal Rule
Analytical Solution: 1.6405333
2 Domains, N=2:
h = 0.4
h
I = ( f (x1 ) + 2 × f (x2 ) + f (x3 ))
2
h
= ( f (0 ) + 2 f (0.4) + f (0.8))
2
0.4
= (0.2 + 2 × 2.456 + 0.232)
2
= 1.0688 x1 x2 x3
Trapezoidal Rule
Analytical Solution: 1.6405333
3 Domains, N=3:
h = 0.8 3
h
I = ( f (x1 )+ 2 × f (x2 )+ 2 × f (x3 )+ f (x4 ))
2
h
= ( f (0)+ 2 f (0.2667)+ 2 f (0.5334)+ f (0.8))
2
0.2667
= (0.2 + 2 ×1.4329 + 2 × 3.4872 + 0.232)
2
= 1.3698 x1 x2 x3 x4
Trapezoidal Rule
Analytical Solution: 1.6405333
4 Domains, N=4:
h = 0.8 4
h
I = ( f (x1 )+ 2 × f (x2 )+ 2 × f (x3 )+ 2 × f (x4 )+ f (x5 ))
2
h
= ( f (0)+ 2 f (0.2)+ 2 f (0.4)+ 2 f (0.6) + f (0.8))
2
0.2
= (0.2 + 2 ×1.288+ 2 × 2.456 + +2 × 3.464 + 0.232)
2
x1 x2 x3 x4 x5
= 1.4848
Error Estimate in Trapezoidal Rule
3
2 3
f (x) = 0.2 + 25x − 200x + 675x − 900x + 400x 4 5
=−
(b− a)
× f ##
2
12N
f ! (x) = 25 − 400x + 2025x2 − 3600x3 + 2000x4
∫ f !!(x)dx 1 0.8 2 3
f !! (x) = 0
(0.8 − 0)
= ∫
0.8 0
(−400 + 4050x −10800x + 8000x )dx
0.8
2
1 " x 10800 3 8000 4 %
= $ −400x + 4050 − x + x '
0.8 # 2 3 4 &0
= −60
Error in Trapezoidal Rule =−
(b− a)
3
× f ##
2
Analytical Solution: 1.6405333 12N
Number
of
Actual Estimated
Domains
1.2
0.8
Error_actual
Error_Es3mated
0.4
0
0 0.2 0.4 0.6 0.8
h
Simpson`s 1/3rd Rule
h = 0.4
h
I = ( f (x1 ) + 4 × f (x2 ) + f (x3 ))
3
h
= ( f (0 ) + 4 × f (0.4) + f (0.8))
3
0.4 x1 x2 x3
= (0.2 + 4 × 2.456 + 0.232)
3
= 1.367
Et = 1.6405333 −1.367 = 0.2735333
ε t = 16.67%
Et,2T = 1.6405333 −1.0688 = 0.5717333
ε t,2T = 34.85% x1 x2 x3
Error Estimate in Simpsons 1/3rd Rule
2 3 4 5 5
f (x) = 0.2 + 25x − 200x + 675x − 900x + 400x (b− a)
=− × f iv
f ! (x) = 25 − 400x + 2025x2 − 3600x3 + 2000x4 180N 4
f !! (x) = −400 + 4050x −10800x2 + 8000x3
f iii (x) = 4050 − 21600x + 24000x2 f iv (x) = −21600 + 48000x
0.8
5
∫ f iv (x)dx 0.8 (b− a)
iv 1 =− × f iv
f (x) = 0
(0.8 − 0)
=
0.8
∫ (−21600 + 48000x)dx 180N 4
0
0.85
2
0.8 =− 4
× (−2400 )
1 " x % 180 × 2
= $ −21600x + 48000 '
0.8 # 2 &0 = 0.27307
Et = 0.2735333
= −2400
Simpson`s 3/8th Rule
h = 0.2667
3h
I = ( f (x1 ) + 3 × f (x2 ) + 3 × f (x3 ) + f (x4 ))
8
3 0.8
= × ( f (0)+ 3× f (0.2667)+ 3× f (0.5334)+ f (0.8))
8 3
= 0.1(0.2 + 3×1.43287 + 3× 3.472 + 0.232 ) x1 x2 x3 x4
= 1.519221
Et = 1.6405333 −1.519221 = 0.1213123
ε t = 7.395%
Et,3T = 1.6405333 −1.3698 = 0.2707333
ε t,3T = 16.5%
x1 x2 x3 x4
Error Estimate in Simpsons 3/8th Rule
2 3 4 5 5
f (x) = 0.2 + 25x − 200x + 675x − 900x + 400x (b− a)
=− × f iv
f ! (x) = 25 − 400x + 2025x2 − 3600x3 + 2000x4 80N 4
f !! (x) = −400 + 4050x −10800x2 + 8000x3
f iii (x) = 4050 − 21600x + 24000x2 f iv (x) = −21600 + 48000x
0.8
5
∫ f iv (x)dx 0.8 (b− a)
iv 1 =− × f iv
f (x) = 0
(0.8 − 0)
=
0.8
∫ (−21600 + 48000x)dx 80N 4
0
0.85
2
0.8 =− 4
× (−2400 )
1 " x % 80 × 3
= $ −21600x + 48000 '
0.8 # 2 &0 = 0.121363
Et = 0.1213123
= −2400
Plug Flow Reactor
FA0 − FA
XA =
FA0
−rA = kCAn
n n
a
x
Open Integration
∫ f (z)dz
−1
Gauss Legendre Quadrature Formula
Gauss Legendre Quadrature Formula
1
Gauss Legendre Quadrature Formula
1
" −1 % " 1 %
−2 $ ' 2$ '
−2u2 # 3& 2u1 # 3&
a1 = = =1 a2 = = =1
(u1 − u2 ) "$ 1 − "$ −1 %'%' (u1 − u2 ) "$ 1 − "$ −1 %'%'
# 3 # 3 && # 3 # 3 &&
Gauss Legendre Quadrature Formula
Gauss Legendre Quadrature -Example
0.8
∫ f (x)dx
0
x=
( 0.8 − 0 )
Z+
" 0.8 + 0 %
x = 0.4Z + 0.4
0.8 1 1
2
$
# 2
'
&
I= ∫ f (x)dx = ∫ 0.4 × f (z)dz = ∫ g(z)dz
0 −1 −1
2
f (z) = 0.2 + 25 ( 0.4 + 0.4Z ) − 200 ( 0.4 + 0.4Z )
3 4 5
+675 ( 0.4 + 0.4Z ) − 900 ( 0.4 + 0.4Z ) + 400 ( 0.4 + 0.4Z )
Model
Equations
These
Set
of
Model
Equations
can
be
written
in
standard
form
for
1st
order
ODE
dyi
= fi (y1, y2 ,....yN )
dt
for
i=1,2,…N
t = 0, yi (0) = αi .......(known)
How
to
recast
in
standard
form?
We
introduce
a
new
dependent
variable
+1
Q(t)
Convert
to
Standard
Form
dy2
=1
dt
dy1 Ah Q (y2 )
= (y1 − T0 )−
dt VρCp ρCp
How
to
recast
in
standard
form?
yi+1 = yi + hf (xi , yi )
Euler Implicit Method
xi xi+1 x
Semi Implicit (Crank Nicholson) Method
h!
yi+1 = yi + " f (xi , yi )+ f (xi+1, yi+1 )#$
2
y
xi xi+1 x
7"
6"
5"
4"
y"
3"
1"
ytrue"
0"
0" 0.5" 1" 1.5" 2"yEuler" 2.5"
Error@
x=0.5
Second
Step: True
Solution
@
x=1.0
5.875-‐3=2.875 3.84375-‐3=0.84375
6"
5"
4"
y"
3"
2"
1"
ytrue"
0"
0" 0.5" 1" 1.5" 2"yEuler" 2.5"
x" y"Euler_local"
7"
yi+1 = yi + hf (xi , yi )
6"
5"
4"
y"
3"
2"
1"
ytrue"
0"
0" 0.5" 1" 1.5" 2"yEuler" 2.5"
x" y"Euler_local"
h 0.5
f(x)
yEul
x =dy/dx ytrue er y
Euler_local Global_Error Local_error
0 8.5 1 1
y (i +1) = y (i )+ h [w1k1 + w2 k2 ] 0.5 1.25 3.22 8.50 4.22 4.22 3.11 3.40
Mid
1 -‐1.50 3.00 1.25 -‐0.59 -‐0.59 2.81 6.25
k1 = f !" y (i ), x (i )#$ 1.5 -‐1.25 2.22 -‐1.50 -‐1.66 -‐1.66 1.98 10.56
k2 = f !" y (i )+ 0.5hk1, x (i )+ 0.5h#$ 2 0.50 2.00 -‐1.25 -‐0.47 -‐0.47 1.75 12.50
Ralston
Method
-‐
¾ h
x f(x) yt k k2 S yR Err
ru 1 or_
yR (i +1) = y (i )+ hs!" y (i ), x (i )#$ 0 8.50 1.00 1.00
yR (i +1) = y(i )+ h [w1k1 + w2 k2 ] 0.5 1.25 3.22 8.50 2.58 4.53 3.27 -‐1.51
w1 = 0.33, w2 = 0.67 1 -‐1.50 3.00 1.25 -‐1.15 -‐0.36 3.09 -‐2.92
k1 = f !" y (i ), x (i )#$ 1.5 -‐1.25 2.22 -‐1.50 -‐1.51 -‐1.51 2.33 -‐5.18
k2 = f !" y (i )+ 0.75hk1, x (i )+ 0.75h#$ 2 0.50 2.00 -‐1.25 0.00 -‐0.41 2.13 -‐6.44
Comparison
6.00
4.50
ytrue
3.00
yH
y
yMid
yR
1.50 YEuler
0.00
0 1 1 2 2
x
]
h
t1 t2
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Ordinary
Differential
Equations
Runge
Kutta
Methods,
Euler
Method
k1 = f (yi , ti )
km = f (yi + h"#qm,1k1 + qm,2 k2 +...... + qm,m−1km−1 $%, (ti + pmh))
Accuracies
p3 q31 q32
Classic RK-4
1 0 0 1
1/6
1/3
1/3
1/6 RK-Fehlberg Method
1 h m+1 h
yi+1 = yi + (k1 + k20 ) yi+1 = yi + (k1 + k2m ) m= 1 to M
2 m+1 m m 2
yi+1 = yi+1 = yi
h!
yi+1 = yi + " f (yi , ti ) + f yi+1, ti+1 #$
( ) CRANK NICHOLSON (SEMI-IMPLICIT METHOD)
+O(h3 )
2
Improved Multi Step Method
non-starting Heun's Method
3
+O(h )
3
+O(h )
0.75
0.5
y
0.25
0
0 1.25 2.5 3.75 5
t
Stability of Euler Method
−λt
Analytical solution y=e
Euler Method
A=
To enforce the stability we want the error at tn+1 to be smaller than tn
Stability Envelope
1.5
0.75
Globally
Stable
0
A= =-‐ve Converges
but
oscillatory
after
-‐0.75
A
this
-‐1.5
-‐2.25 Converges
Euler
(-‐inf) Implicit
(0) before
this
Crank
Nicholson
(-‐1)
Oscillatory
-‐3
and
diverges
0 1 2 3 4
hlambda
Richardson Extrapolation
# h&
Δ = yi+1 − yi+1 % (
same $2'
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Ordinary
Differential
Equations
Runge
Kutta
Methods,
Euler
Method
# h&
Δ = yi+1 − yi+1 % (
same $2'
3
3
Concept of Adaptive Step-Size
Step-Size? Value of λ?
If Δnew~εtol 1/n
# ε tol &
hnew = % ( h
$ Δ '
If εtol~10-2, n=2 0.5 0.5
! 0.01 $ ! 0.01 $
Δ1=0.0625 hnew = # & h = 0.4h Δ2=0.00625 hnew = # & h = 1.265h
" 0.0625 % " 0.00625 %
a0 = 0 Explicit Implicit
Backward Difference Formula
Implicit Euler
α (α +1) 2 α (α +1).. (α + n− 2)
Pn−1 (i ) = fi +α∇fi + ∇ fi +... + ∇ n−1 f
2! 2!
t − ti
α=
h
ti+1 1 1
yi+1 − yi = ∫ Pn−1 (i )dt = ∫ Pn−1 (i )hdα = h ∫ Pn−1 (i )dα
ti 0 0
1
yi+1 = yi + h ∫ Pn−1 (i )dα
0
O(hn)
LTE:::O(hn+1)
GTE:::O(hn)
α (α +1) 2 α (α +1).. (α + n− 2)
Pn−1 (i ) = fi +α∇fi + ∇ fi +... + ∇ n−1 f
2! 2!
t − ti
α=
h ti+1 1 1
yi+1 − yi = ∫ Pn−1 (i )dt = ∫ Pn−1 (i )hdα = h ∫ Pn−1 (i )dα
ti 0 0
1 1
❖ n=1
yi+1 = yi + h ∫ P0 (i )dα = yi + h ∫ fi dα = yi + hfi
0 0
LTE:::O(h2) GTE:::O(h1)
Adams
Bashforth
1st
Order
M
1
ethod
1 1 $ 2 &
❖ n=2 yi+1 = yi + h ∫ P1 (i )dα = yi + h ∫ $% f (i )+α∇fi &'dα = yi + h)α fi + ( fi − fi−1 )* = h 3 fi − 1 fi−1
α $ &
)% *'
0 0 % 2 '0 2 2
LTE:::O(h3) GTE:::O(h2) Adams
Bashforth
2ndOrder
Method
1 1$ α (α +1) 2 ' $ 23 4 5 '
❖ n=3 yi+1 = yi + h ∫ P2 (i )dα = yi + h ∫ & f (i )+α∇fi + ∇ f )dα = yi + h& fi − fi−1 + fi−2 )
0 0 % 2! ( %12 3 12 (
4 3 rd
@i = 0 y1 = y0 + a1 f0 + a2 f−1 + a3 f−2
@i =1 y2 = y1 + a1 f1 + a2 f0 + a3 f−1
@i = 2 y3 = y2 + a1 f2 + a2 f1 + a3 f0
AM
n
method
NUMERICAL METHODS IN
CHEMICAL ENGINEERING
CLL-‐113
Ordinary
Differential
Equations
Boundary
Value
Problem
Shooting
method,
Finite
Difference
Method
Prof.
Jayati
Sarkar
ODE-IVP : Auxiliary condition at 1 point y
y0
x
CA (x = L ) = 0
Assume:
dy1
= y2
dx
dy2
+ py2 + q = 0
dx
dy2
= −py2 − q
dx
d ! y1 $ ! y2 $
# &=# &
dx " y2 % "−py2 − q%
Ta=30°C
d 2T
2
= 0.01(T − Ta )
dx
T(0)=30°C T(L)=80°C
y1 = T
Actual BC:
y1 = 30@x = 0
d ! y1 $ ! y2 $
# &=# & y1 = 80@x = L
dx " y2 % "0.01(y1 − 30)%
Modified BC:
y1 = 30@x = 0
y2 = 0@x = 0
Fundamentals
of
CFD
(CLL:113)
NUMERICAL*METHODS*IN*
CHEMICAL*ENGINEERING*
Dr.
Jayati
Sarkar
CLL#113&
Email:
jayati@chemical.iitd.ac.in
&
Lecture 8
Ordinary&Differential&Equations&
PDE&
Department of Chemical Engineering, IIT Delhi,
NewProf.&Jaya*&Sarkar&
Delhi, India
Classification
of
Partial
Differential
Equations
t >0
T0 T0
0 L/2 x
T⎯⎯→∝
2 L $ nπ x '
where Bn = ∫ (Ti (x) − To )sin & ) dx
L0 % L (
Important lessons to learn!
The boundary temperature T0 influences the temperature
T(x,t) at every point in the domain, just as with elliptic
PDE’s
The initial conditions only affect future temperatures, not past
temperatures.
Parabolic
Partial
Differential
Equation
(Contd.)
∞ −αn2π 2
t
Solution is given by $ nπ x ' L2
T (x, t ) = T0 + ∑ Bn sin & )e
n=1
% L (
2 L $ nπ x '
where Bn = ∫ (Ti (x) − To )sin & ) dx
Important lessons to learn! L0 % L (
The initial conditions influence the temperature at every point
in the domain for all future times. The amount of influence
decreases with time, and may affect different spatial points to
different degrees.
A steady state is reached for t ∞. Here, the solution becomes
independent of Ti
(x ,0) . It also recovers its elliptic spatial behavior.
The temperature is bounded by its initial and boundary
conditions in the absence of source term
Hyperbolic
Partial
Differential
Equations
• 1D flow of fluid in a
channel
∂ (ρCPT ) ∂ (ρCPUT )
+ =0
∂t ∂t
Temperature Variation with time
with
Important lessons to learn! T (x,0) = Ti (x)
1.The upstream boundary conditions and
T (x ≤ 0,t )= T0
not the downstream condition affects the
solution of the domain. Solution is given by
2. The inlet boundary condition T ( x , t ) = T ((x −Ut ),0 )
propagates with a finite speed U.
or x
3. The inlet boundary condition T (x,t ) = Ti for t <
U
is not felt at point x until t=x/U. x
=T 0 for t ≥
U
Laplace
Equation
(Elliptic)
• Heat
Transfer
in
2D
8
Laplace
Equation
(Elliptic)-‐Dirichlet
Boundary
Condition
• Heat
Transfer
in
2D
• Gauss Seidel
9
Laplace
Equation
(Elliptic)
10
• Solution
after
9th
iteration
Laplace
Equation
(Elliptic)
• Post
Processing(Heat
Fluxes)
11
• Solution
after
9th
iteration Laplace
Equation
(Elliptic)
• Post
Processing(Heat
Fluxes)
12
Laplace
Equation
(Elliptic)-‐Neumann
Boundary
Condition
13
Laplace
Equation
(Elliptic)-‐Neumann
Boundary
Condition
14
Unsteady
Heat
Conduction
Equation
(Parabolic)
15
Unsteady
Heat
Conduction
Equation
(Parabolic)
16
Unsteady
Heat
Conduction
Equation
(Parabolic)
17
NUMERICAL*METHODS*IN*
CHEMICAL*ENGINEERING*
CLL#113&
&
Ordinary&Differential&Equations&
PDE&
Prof.&Jaya*&Sarkar&
18
19