Вы находитесь на странице: 1из 19

CH 3073: Numerical Methods

CH 5490: Numerical Methods I

Autumn 2014-15

Instructor: Dr. Kishalay Mitra


Department of Chemical Engineering
Indian Institute of Technology Hyderabad
(kishalay@iith.ac.in)

Ref: S. K. Gupta, Numerical Methods for Engineers, New Age Intl. Publishers,
New Delhi, 2nd Ed., 2009.

Indian Institute of Technology Hyderabad


Taylor Series
The general form of the Taylor series is given by
f x  2 f x  3
f x  h   f  x   f  x h  h  h 
2! 3!
provided that all derivatives of f(x) exist in the interval [x,
x+h]
Plain English
As Archimedes would have said, “Give me the value of the
function at a point, and the value of all (first, second, and so
on) its derivatives at that point, and I can give you the value of
the function at any other point”

• Derivative information has to be available only in the interval


• h need not necessarily be in the near vicinity of x

2 Indian Institute of Technology Hyderabad


Taylor Series - Example
Find the value of f 6 given that f 4  125, f 4  74,
f 4  30, f 4  6 and all other higher order derivatives
of f x at x  4 are zero.
h2 h3 x4
Solution: f x  h   f x   f x h  f x   f x    h  64  2
2! 3!
Since the higher order derivatives are zero,
22 23  2 2   23 
f 4  2  f 4  f 42  f 4  f 4 f 6  125  742  30   6 
2! 3!  2!   3! 
 125  148  60  8  341

Note that to find f 6 exactly, we only need the value


of the function and all its derivatives at some other
point, in this case x  4

3 Indian Institute of Technology Hyderabad


Representing Dynamic Systems
𝐝𝐗
Consider system expressed by =𝐟 𝐗
𝐝𝐗 𝐝𝐭
𝟏
𝐝𝐭
𝐝𝐗 𝟐 𝐟𝟏 𝐗 𝟏 , 𝐗 𝟐 , … 𝐗 𝐍
𝐝𝐗 𝐟𝟐 𝐗 𝟏 , 𝐗 𝟐 , … 𝐗 𝐍
𝐝𝐭
. ≡ = 𝐟 𝐗 ; 𝐗 𝐭 = 𝟎 = 𝐗𝟎 𝐟 𝐗 = .
. 𝐝𝐭 .
. 𝐟𝐍 (𝐗 𝟏 , 𝐗 𝟐 , … 𝐗 𝐍 )
𝐝𝐗 𝐍
Nonlinear Ordinary Differential equation – Initial Value Problem
𝐝𝐭
 AT STEADY STATE (X1,s, X2,S), the rate of change term goes to ZERO

𝟎 𝐟 𝐗 ,𝐗
≡ 𝟎 = 𝐟(𝐗) ≡ 𝟏 𝟏 𝟐
𝟎 𝐟𝟐 𝐗 𝟏 , 𝐗 𝟐
Nonlinear algebraic equation (NR) to obtain
steady state values
4 Indian Institute of Technology Hyderabad
Stability Analysis
Suppose
 F COMPRISES ONLY TWO VARIABLES, X1 AND X2 (T and
composition in a reactor)

 STEADY STATE ( ): X1,s, X2,S; . IN FIGURE

 NOW INTRODUCE A SMALL DISTURBANCE/PERTURBATION TO


⊗ AND SEE WHAT HAPPENS:

 SYSTEM SLOWLY RETURNS TO . : STABLE SS


 GOES AWAY FROM . : UNSTABLE SS

5 Indian Institute of Technology Hyderabad


Stability Analysis (contd.)

 PHASE PLANE PLOT


 STATES AS A FNCTION OF TIME
 Discussed with an example of CSTR – occurs in other systems also
(electrical, mechanical systems etc.)

6 Indian Institute of Technology Hyderabad


Deviation Variable
dX Path taken to come
USS =f X : ICs
dt back to steady state
SS f X =0

ζ1 t ≡ X1 t − X1,s
. dζi dXi
ζi t ≡ Xi t − Xi,s = − 0 = fi X 1 , X 2 , … , X N
dt dt
.
ζN t ≡ XN t − X N,s

7 Indian Institute of Technology Hyderabad


Multi Variable Taylor Series
dζi
= fi X 1 , X 2 , … , X N
dt
dζi
= fi X1,s + ζ1 , X2,s + ζ2 , … , XN,s + ζN Since ζ1 t ≡ X1 t − X1,s
dt
Single Variable Taylor Series around Xs
dy 1 d2 y 2
y Xs + ζ = y Xs + |s ζ + 2
|s ζ + ⋯
dX 2! dX
Multi Variable Taylor Series SS f X =0
0 neglect
dζi 𝜕fi 𝜕fi 𝜕fi
= fi |s + |ζ + | ζ +⋯+ |s ζN + higher order terms
dt 𝜕X1 s 1 𝜕X2 s 2 𝜕XN
dζi
≡ ai1 ζ1 + ai2 ζ2 + … + aiN ζN
dt
(ai,1, ai,2,…….,ai,N ARE ALL NUMBERS)

8 Indian Institute of Technology Hyderabad


Taylor Series (contd.)
Jacobean 𝜕fi
Putting it all together
dζ1 aij ≡ |s
𝜕Xj
We do not use GS or something dt a11 a12 … a1N ζ1
else to solve this because these dζ2 a21 a22 … a2N ζ2
are differential equations dt . .
. =

These are numbers


. .
This is N linear coupled ODEs .
of the first order – need something
. .
.
like Runge-Kutta etc. dζN aN1 aN2 … aNN ζN
dt
≡ A ζ ; ζi t = 0 = ζi,0
d2y dy
 5  7y  0;ASSUMED y  Ce mt
;y  C1e m1 t
 C 2e m2 t

dt 2 dt

Similarly, we assume ζi = zi eλt

9 Indian Institute of Technology Hyderabad


Taylor Series (contd.)
Putting it all together
dζi
≡ ai1 ζ1 + ai2 ζ2 + … + aiN ζN ζi = zi eλt
dt
zi λeλt ≡ ai1 z1 eλt + ai2 z2 eλt + ⋯ + aii zi eλt + ⋯ + aiN zN eλt
0 = ai1 z1 + ai2 z2 + ⋯ + aii −λ zi + ⋯ + aiN zN
0 z1
0 z2
a11 − λ , ⋯ , a1N z3
0
0= =. ⋮ ⋱ ⋮ .
.
aN1 , ⋯ aNN − λ .
.
0 zN
= A − λI z

10 Indian Institute of Technology Hyderabad


Eigen Values
A − λI z = 0

HOMOGENEOUS EQUATION → TRIVIAL SOLN


NON-TRIVIAL SOLNS → RANK A − λI < N
FOR RANK A − λI < N, Determinant A − λI = 0
2 1
Example: A =
5 6
2−λ 1
A − λI = POLYNOMIAL OF ORDER 2 IN λ = 0
5 6−λ
For 3 by 3 case, it will be cubic in λ you get 3 values of λ
For N by N case, you get N values of λ
N

ζi = C i eλi t
i=1
11 Indian Institute of Technology Hyderabad
Eigen Values to Stability
In Summary

ζi t = pi eλ1t + qi eλ2t + ⋯ + ri eλNt


ROOTS CAN BE COMPLEX CONJUGATE PAIRS OR
REAL
λ  5  6j  p .e5t.e6jt  e5t  BLOWS UP;
i i
ANY ROOT HAVING POSITIVE REAL PART WILL BLOW
OFF
ANY ROOT HAVING NEGATIVE REAL PART WILL
CONVERGE
ANY ROOT HAVING COMPLEX VARIABLE WILL LEAD
TO SIN – COS TERM - OSCILLATIONS

12 Indian Institute of Technology Hyderabad


Some Results
Mathematical Facts without proof

If  is Eigenvalue of A, it is eigenvalue of AT also & (1/) is Eigenvalue of A-1

For any matrix, Eigenvectors of distinct Eigenvalues are linearly independent

For a real symmetric matrix, all Eigenvectors are linearly independent even if
Eigenvalues are not distinct

For a real symmetric matrix, Eigenvalues are all real (not necessarily distinct)

For a real symmetric matrix, N linearly independent Eigenvectors can be


made to form an orthogonal set of N vectors using Gram-Schmidt procedure
(xi and xj are said to be orthogonal if xiTxj = 0; In addition if xiTxi = 1 and xjTxj =
1, they are said to be orthonormal)

Spectral radius (A) of a matrix is defined by


ρ(A)  max | λ i |
i

13 Indian Institute of Technology Hyderabad


FADEEV LEVERRIER
𝐚𝟏𝟏 − 𝛌 𝐚𝟏𝟐
𝐀 − 𝛌𝐈 = 0 =𝟎
𝐚𝟐𝟏 𝐚𝟐𝟐 − 𝛌

𝐚𝟏𝟏 − 𝛌 𝐚𝟐𝟐 − 𝛌 − 𝐚𝟏𝟐 𝐚𝟐𝟏 = 𝟎

𝛌𝟐 − 𝐚𝟏𝟏 + 𝐚𝟐𝟐 𝛌 + 𝐚𝟏𝟏 𝐚𝟐𝟐 − 𝐚𝟏𝟐 𝐚𝟐𝟏 = 𝟎

Similarly
𝐀 − 𝛌𝐈 𝐍×𝐍
= −𝟏 𝑵 𝛌𝐍 − 𝛂𝟏 𝛌𝐍−𝟏 + 𝛂𝟐 𝛌𝐍−𝟐 + ⋯ + −𝟏 𝑵𝛂
𝐍 𝛌𝟎

≡ 𝑷𝑵 𝝀 = 𝟎
𝛌 − 𝛌𝟏 𝛌 − 𝛌𝟐 … 𝛌 − 𝛌𝐍 = 𝟎 CHARACTERISTIC POLYNOMIAL

EXAMPLE: 𝛌𝟐 + 𝟓𝛌 − 𝟔 = 𝟎 𝛌 − 𝛌𝟏 𝛌 − 𝛌𝟐 = 𝟎

14 Indian Institute of Technology Hyderabad


Example Assume x3 = 1; Check the
orthogonality of the vectors

15 Indian Institute of Technology Hyderabad


FADEEV LEVERRIER (contd.)
𝐍 𝐍
TRACE (Tr) 𝐀 ≡ 𝐢=𝟏 𝐚𝐢𝐢 = 𝐢=𝟏 𝛌𝐢 =p1
𝐍 𝟐
𝛌
𝐢=𝟏 𝐢 = 𝐓𝐫 𝐀 𝐀 ≡ 𝐓𝐫 𝐀𝟐 =p2
𝐏𝐍 𝝀 = −𝟏 𝑵 𝛌𝐍 − 𝛂𝟏 𝛌𝐍−𝟏 + 𝛂𝟐 𝛌𝐍−𝟐 + ⋯ + −𝟏 𝑵𝛂 𝛌𝟎
𝐍
𝑵
= −𝟏 𝛌 − 𝛌𝟏 𝛌 − 𝛌𝟐 … 𝛌 − 𝛌𝐍 = 𝟎

𝛌 − 𝛌𝟏 𝛌 − 𝛌𝟐 = 𝛌𝟐 − 𝛌𝟏 + 𝛌𝟐 𝛌 + 𝛌𝟏 𝛌𝟐
𝛌 − 𝛌𝟏 𝛌 − 𝛌𝟐 𝛌 − 𝛌𝟑 = 𝛌𝟑 − 𝛌𝟏 + 𝛌𝟐 + 𝛌𝟑 𝛌𝟐
+ 𝛌𝟏 𝛌𝟐 + 𝛌𝟏 𝛌𝟑 + 𝛌𝟐 𝛌𝟑 𝛌 − 𝛌𝟏 𝛌𝟐 𝛌𝟑 = 𝟎
𝛂𝟏
𝛌 − 𝛌𝟏 𝛌 − 𝛌𝟐 𝛌 − 𝛌𝟑 𝛌 − 𝛌𝟒 = 𝛌 − 𝛌𝟏 + 𝛌𝟐 + 𝛌𝟑 + 𝛌𝟒 𝛌𝟑
𝟒

𝛂𝟐 + 𝛌𝟏 𝛌𝟐 + 𝛌𝟏 𝛌𝟑 + 𝛌𝟏 𝛌𝟒 + 𝛌𝟐 𝛌𝟑 + 𝛌𝟐 𝛌𝟒 + 𝛌𝟑 𝛌𝟒 𝛌𝟐
− 𝛌𝟏 𝛌𝟐 𝛌𝟑 + 𝛌𝟏 𝛌𝟐 𝛌𝟒 + 𝛌𝟏 𝛌𝟑 𝛌𝟒 + 𝛌𝟐 𝛌𝟑 𝛌𝟒 𝛌 + 𝛌𝟏 𝛌𝟐 𝛌𝟑 𝛌𝟒 = 𝟎
𝛂𝟑 𝛂𝟒
16 Indian Institute of Technology Hyderabad
FADEEV LEVERRIER (contd.)
𝐍
𝛂𝟏 = 𝐢=𝟏 𝛌𝐢 = 𝐓𝐫 𝐀 ≡ 𝐩𝟏 (p are traces)

𝛂𝟐 = 𝛌𝟏 𝛌𝟐 + 𝛌𝟏 𝛌𝟑 + ⋯ + 𝛌𝐍−𝟏 𝛌𝐍
𝛂𝟑 = 𝛌𝟏 𝛌𝟐 𝛌𝟑 + 𝛌𝟏 𝛌𝟐 𝛌𝟒 + ⋯ + 𝛌𝐍−𝟐 𝛌𝐍−𝟏 𝛌𝐍

𝛂𝟏 𝐩𝟏 = 𝛌𝟏 + 𝛌𝟐 + ⋯ 𝛌𝟏 + 𝛌𝟐 + ⋯
= 𝛌𝟐𝟏 + 𝛌𝟐𝟐 + ⋯ + 2 𝛌𝟏 𝛌𝟐 + 𝛌𝟏 𝛌𝟑 + ⋯ + 𝛌𝐍−𝟏 𝛌𝐍
= 𝐓𝐫 𝐀𝟐 + 𝟐𝛂𝟐 = = 𝐩𝟐 + 𝟐𝛂𝟐
𝛂𝟐 = 𝛂𝟏 𝐩𝟏 − 𝐩𝟐 𝟐 𝟑𝛂𝟑 = 𝛂𝟐 𝐩𝟏 − 𝛂𝟏 𝐩𝟐 + 𝐩𝟑

GENERALIZATION
𝐢−𝟏
𝑖𝛂𝐢 = 𝛂𝐢−𝟏 𝐩𝟏 − 𝛂𝐢−𝟐 𝐩𝟐 + ⋯ + −𝟏 𝐩𝐢
17 Indian Institute of Technology Hyderabad
FR Sequence
SEQUENCE OF OPERATIONS

GIVEN 𝐀 𝒑𝟏 (= 𝜶𝟏 )
𝐀𝟐 𝒑𝟐 𝛂𝟐
𝐀𝟑 𝐩𝟑 𝛂𝟑

𝐀𝐍 𝐩𝐍 𝛂𝐍

𝐍
−𝟏 𝛌𝐍 − 𝛂𝟏 𝛌𝐍−𝟏 + 𝛂𝟐 𝛌𝐍−𝟐 + ⋯ + −𝟏 𝐍 𝛂𝐍 𝛌𝟎 = 𝟎

ASSIGNMENT : 2.1, 2.2, 2.4


READ QUESTION 1.9

18 Indian Institute of Technology Hyderabad


Example – FR for 
If  is Eigenvalue of A,
it is eigenvalue of AT
also & (1/) is
Eigenvalue of A-1

19 Indian Institute of Technology Hyderabad