Lect 13 14
Lect 13 14
Numerical Methods
A set of ODEs are solved very similarly
(Ordinary Differential Equations-3&4)
dy
f1 ( x, y , z ) with y yo at x xo
dx
Kannan Iyer dz
[email protected] f 2 ( x, y , z ) with z zo at x xo
dx
Modified Euler’s method
k11 f1 ( xn , yn , z n ) k 21 f1 xn h, y n 1 , z n 1
k12 f 2 ( xn , yn , z n ) k 22 f 2 xn h, y n 1 , z n 1
Department of Mechanical Engineering
Indian Institute of Technology Jammu y n 1 y n hk11 y n 1 y n h / 2k11 k 21
z n 1 z n hk12 z n 1 z n h / 2k12 k 22
1
4:09 PM 5/31 4:09 PM 6/31
y
1.20
A step sixe of dx = 0.05 is y 0.80
required for accurate sol.
0.80
0.40
0.40 0.00
0.00 2.00 4.00 6.00
x 0.00 20.00
x 40.00 60.00
Shooting method
Boundary Value Problem
The equation is split into a system of three first
ff 2 f 0 ; f ( 0 ) 0 , f ( 0 ) 0 , f ( ) 1. order equations
2
4:09 PM 9/31 4:09 PM 10/31
3
4:09 PM 13/31 4:09 PM 14/31
4
4:09 PM 17/31 4:09 PM 18/31
5
4:09 PM 21/31 4:09 PM 22/31
Finite differences -X Simple Application-I
1
P3( x0 ) ( f1 f 0 ) ( f 2 2 f1 f 0 )
2
2 1 d2y dy
( f 3 3 f 2 3 f1 f 0 ) O ( h 3 ) 2
a by 0
6 h dx dx
2 f 9 f 2 18 f1 11 f 0 )
3 O(h 3 ) with y ( x 0) y0 , y ( x L) y L
6h Forward Difference
5
P3( x3 ) ( f1 f 0 ) ( f 2 2 f1 f 0 )
2
11 1 1 i-1 i i+1 n
( f 3 3 f 2 3 f1 f 0 ) O(h 3 )
6 h
11 f 3 18 f 2 9 f1 2 f 0 )
O (h3 ) Backward Difference
6h
6
4:09 PM 25/31 4:09 PM 26/31
Simple Application-IV Simple Application-V
Writing FDE at point i
Treatment of Neumann Boundary Condition
d2y dy y( i 1 ) 2 y( i ) y( i 1 ) y( i 1 ) y( i 1 )
a by( i ) 0
2
a by 0 h 2
2h
1
X=L
7
4:09 PM 29/31 4:09 PM 30/31
Simple Application-VII Treatment of Non-Linearity-I
A tri-diagonal matrix will be obtained by performing two Consider a non-linear Equation
Gauss operations
First by performing Gauss Operation between i-2 and i y 2 y 2 y 0
rows, a(i-3),i can be reduced to 0 When a finite difference equation is written for a node, it
Then by performing a Gauss operation between i-1 and I will lead to a non-linear equation due to the presence of
rows, we can reduce a(i-2),i to 0 higher order powers
Thus, tri-diagonal structure is restored and can be solved In such cases to get a linear form of the equation, we need
by TDMA to resort to iterations
The procedure is to assume a y distribution
Linearise and solve for y
Iterate until convergence is reached
The underlying principles used in linearisation are
discussed in next slide
4:09 PM 31/31
Treatment of Non-Linearity-II
The term y 2 y is linearised as
y y
2 k k 1
y k 1 y k 1 (1 ) y k
α is assumed to have a value between 0 and 1
The above suppresses wild variations of y introduced by
the iteration method
Severe non-linearity may force the value of α close to zero
Convergence criterion is similar to what we normally do by
controlling the normalized values between the iterations