6 PDE Basics
6 PDE Basics
Partial Differential
Equations
Analisis
Numerik
1 1
What is a Partial Differential
Equation
⚫ ? Equations have only one
Ordinary Differential
independent variable
dy
3 dx 5y 2 3ex , y(0)
⚫ Partial Differential Equations have more than one
5
independent variable
2u 2
32 2 y2
u
x y
x 2
subject to certain conditions: where u is the dependent variable, and
x and y are the independent variables.
2
Example of an Ordinary
Differential Equation
Spherical
Ball
Hot Water
hA a mC
dt
d Ball is a lumped
⚫ Assumption:
system.
⚫ Number of Independent variables:
One (t) 3
Example of an Partial
Differential Equation
Spherical
Ball
Hot Water
k T
k 2 T 2 k sin T C , t 0, T (r, ,,0)
r
2
T 2
r 2 r r sin r sin T
2
t
r⚫ Assumption: Ball is not a lumped
2
system.
⚫ Number of Independent variables:
Four (r,θ,φ,t) 4
Classification of 2nd Order Linear
PDE’s
2u
A2 2 B C2 D
u
x xy yu
2
0
7
Classification of 2nd Order Linear
PDE’s:
Elliptic
2u
A2 2 B D
u
x u
2
2
C xy y 0
Exampl 2T 2T
e: 0
where, A 2 B 0,C
x 1, y 2 1
B 2 4AC 0 4(1)(1) 4
giving
0
therefore the equation is
elliptic.
8
Classification of 2nd Order Linear
PDE’s:
Parabolic
2u
A2 2 B C2 D
u
x xy yu
2
0
2
If B 4AC 0 ,then
the equation is
parabolic.
9
Classification of 2nd Order Linear
PDE’s:
Parabolic
2u
A2 2 B D
u
x u
2
2
C xy y 0
Exampl T
k
e: 2t
T x 2
where, A k, B 0,C 0
Bgiving
2
4AC 0 4(0)(k)
therefore the equation is
0
parabolic. 10
Classification of 2nd Order Linear
PDE’s:
Hyperbolic
2u
A2 2 B C2 D
u
x xy yu
2
0
2
If B 4AC 0 ,then
the equation is
hyperbolic.
11
Classification of 2nd Order Linear
PDE’s:
Hyperbolic
2u
A2 2 B D
u
x u
2
C xy
2
y 0
Exampl 2y 1 2
e: x2 c 2 t
y2
1
where, A 1, B 0,C 2
c
giving
2 1 4 0
B 4AC 0 4(1)( 2 ) 2
c
therefore the equation is c
12
Parabolic Partial
Differential
Equations
12/3/202 http://numericalmethods.eng.usf.e 1 1
4 du 3
Defining Parabolic
⚫
PDE’s
The general form for a second order linear PDE with two
independent variables and one dependent variable is
A
u u
2 2
u
2
D
B C 0
⚫ x 2
xy y 2
Recall the criteria for an equation of this type to be
2 4AC parabolic
considered
B
⚫ 0
For example, examine the heat-conduction
equation
2T given by
, A , B 0,C 0, D
T2
x t wher 1
The e
n 2 4 AC 0 4( )
B
(0)
0us to classify this equation as
thus allowing
parabolic.
14
Physical Example of an
Elliptic PDE
2
T
x
t 15
Discretizing the Parabolic PDE
x
x x
i 1 i i 1
Schematic diagram showing interior
nodes
For a rod of length L divided into n 1 nodes x n
L
The time is similarly broken into time
steps of t
Hence Ti j corresponds to the temperature at node
x ix
i ,that is,
and time t
16
The Explicit Method
x
x x
i 1 i i 1
L
If we define x we can then write the finite central divided
difference
n
approximation of the left hand side at a general interior
node ( i ) as T
2
j
T i1 2T j T j
i i1
x2 i, j
x
2
where ( j ) is the node number along
the time. 17
The Explicit Method
x
x x
i 1 i i 1
1 T 25
C
T 100 C 0.01m
21
Example 1: Explicit Method
Recall, Number of time
steps,
k t final tinitial
C t
therefor 90
3
e,
54
7800 490
3.
1.4129 m /
2
Boundary
105 Conditions
s. T 0j
25C
100C forall j
Then, T 5j
0,1,2,3
t
3
All internal nodes are
x
1.4129
2 5
10 0.01 2
at 20C for t 0sec. This
can be represented as,
0.4239.
T i0 20C, for all i
1,2,3,4
22
Example 1: Explicit Method
Nodal temperatures when t 0sec , j
0: T00 100C
T1 0
0
T2
20C C
Interior nodes
20
0
T3 C
T40 C
20
20
T0
5
25C
We can now calculate the temperature at each node
explicitly using the equation formulated earlier,
T j1
T 2T i j Ti1j
j
i1
T ji 23
i
Example 1: Explicit Method
Nodal temperatures when t 3sec (Example
iCalculations)
T0 100C Boundary Condition
1
0 setti j
i Tng1 T
1
1
0
020T 2T1 0 T00 i T21 T2 0 30T 2T20 T10
1 20 0.423920 2(20) 20 0.423920 2(20)
2
100 20
20 0.423980 20 0.42390
20 33.912 20 0
53.912C 20C
Nodal temperatures when t 3sec ,
T01 100C Boundary Condition
j 1:
T1 1 53.912C
T21 Interior nodes
20C
T3
1
20C
1
T4
C
T22.120
5
1
25C Boundary Condition
24
Example 1: Explicit Method
Nodal temperatures when t 6sec (Example
iCalculations)
T0 100C Boundary Condition
2
0 setting j
i T12 T11 T21 2T 11 T01 T T21 T 31 2T 21 T11
i2
1 1 , 53.912 0.423920 2(53.912) 2
20 0.4239 20 2(20)
100 53.912
2
25
Example 1: Explicit Method
Nodal temperatures when t 9sec (Example
iCalculations)
T0 100C Boundary Condition
3
0 setting
i j2 , i
T113 T1 2 T22 2T12 T02 2T2
3
T22 T32 2T 22 T12
59.073 0.423934.375 2(59.073) 34.375 0.423920.899 2(34.375)
100 59.073
59.073 0.423916.229 34.375 0.423911.222
65.953C
59.073 6.8795 39.132C
34.375 4.7570
Nodal temperatures
t 9sec, j 3 :
when 3
T0 100C BoundaryCondition
T1 3 65.953C
3
T2 C
Interior nodes
39.132
3
T3 C
27.266
T43 C
T22.872
5
3
25C Boundary
Condition
26
Example 1: Explicit
Method
To better visualize the temperature variation at
different locations at different times, the
temperature distribution along the length of the
rod at different times is plotted below.
27
The Implicit Method
WHY:
29
The Implicit Method
2
T T
x 2
The first derivative on the right hand side of the
equation is approximated by the B D D scheme at
a
time level j 1 at node ( i )
s t
T T i j1 T j
i
t t
i, j1
30
The Implicit Method
2 T2 T
x t
j 1 j 1
T i1 2T j1
T Ti j 1 T ij
x
i i1
t
2
31
The Implicit Method
From the previous
slide,
j 1 j 1 j 1
Ti1 2T i
T i1
T ij 1 T ij
x t
2
Rearranging
yields
T i1j1 (1 i
j1
T i1j1 i
j
given
2)T T
that,
t
x
The rearranged equation
2 can be written for every node
during each
time step. These equations can then be solved as a
simultaneous system of linear equations to find the nodal
temperatures at a particular time.
32
Example 2: Implicit Method
Consider a steel rod that is subjected to a temperature of 100C
on the left end and 25C on the right end. If the rod is of
length0.05m ,use the implicit method to find the temperature
distribution in the rod from t 0 and t 9 seconds. Use x
W J
t C
Given: k m . K , 7800 kg
,
0.01m 3s
490 kg K
m3
54
,
The initial temperature of the rod
is 20C .
i0 2 3 4 5
1 T 25
C
T 100 C 0.01m
33
Example 2: Implicit Method
Recall, Number of time
steps,
k t final tinitial
C t
therefor 90
3
e,
54
7800 490
3.
1.4129 m /
2
Boundary
105 Conditions
s. T 0j
25C
100C forall j
Then, T 5j
0,1,2,3
t
3
All internal nodes are
x
1.4129
2 5
10 0.01 2
at 20C for t 0sec. This
can be represented as,
0.4239.
T i0 20C, for all i
1,2,3,4
34
Example 2: Implicit Method
Nodal temperatures when t 0sec , j
0: T00 100C
T1 0
0
T2
20C C
Interior nodes
20
0
T3 C
T40 C
20
20
T0
5
25C
We can now form our system of equations for the first
time step by writing the approximated heat conduction
equation for each node.
T j1
i1 (1 )Ti j1
T j1
i1 i
j
2 T
35
Example 2: Implicit Method
Nodal temperatures when t 3sec , (Example
i T 1
100C
Calculations)
0 Boundary Condition
0 the interior nodes setting j 0 and i 1, 2,3, 4 gives the
For
ifollowing,
T 1 (1 )T 1 T 1 0
0 1 2 1
1 2
(0.4239 T (1 2 0.4239)T 1 (0.4239T 1 )
100)
20
1
2
42.39 1.8478T 1 0.4239T 1 20
1 2
1 1 0.4239T
1.8478T 62.390
1 1
1 1 2 0
i2 T 1 (1 2)T 2 T 3 2
0.4239T 11 1.8478T 21 0.4239T 31
T
20
For the first time step we can write four such
equations with four unknowns, expressing them in
matrix
1.8478 form yields
0.4239 0
0 T 11 62.390
0.4239 1.8478 0.4239 1
20
0
T2
0 1.8478 20
0.4239
3
1.8478 T41 30.598
3
Example 2: Implicit Method
1.8478 0.4239 0
0 T 11 62.390
0.4239 1.8478 0.4239 1
20
0
T2
0 1.8478 20
0.4239 3
1.8478 T41 30.598
0
The 0above coefficient matrix
0.4239 is tri-diagonal. Special
algorithms such as Thomas’ algorithm can be used
T 1 linear equation with tri-
to solve simultaneous
diagonal coefficient matrices.The solution is given
0.4239
by T 1
T 11 39.451 0
100
Hence, the T1
1 39.451
24.792
T 21 nodal temps at t
T 21 24.792
T 3 21.438
1 3sec are 1
T
3 21.438
T41 21.477
T 1 21.477
4
25
T51
3
Example 2: Implicit Method
Nodal temperatures when t 6sec , (Example
i T 2
100C
Calculations)
0 Boundary Condition
0 the interior nodes setting j 1 and i 1, 2,3, 4 gives
For
ithe
following,
T 2 (1 )T 2 T 2 1
0 1 2 1
1 2
(0.4239 T (1 2 0.4239)T 2 0.4239T 2
100)
39.451
1
2
42.39 1.8478T 2 0.4239T 2 39.451
1 2
1.8478T2 1 0.4239T 81.841
2 2
i T 1 (1 2)T2 T 32 221
2
2 T
0.4239T 12 1.8478T 22 0.4239T 32
For the 24.792
second time step we can write four such
equations with four unknowns, expressing them in
matrix
1.8478 form yields
0.4239 0 0 12
0.4239 1.8478 T 24.792
81.841
T 2
22
0 0.4239 0 T3 21.438
0.4239 2
1.8478 0.4239 T 4 32.075 3
Example 2: Implicit Method
1.8478 0.4239 0 0 12
T 81.841
0.4239 1.8478 2 24.792
T2
0 0.4239
0 T 2
3 21.438
0.4239 1.8478 0.4239 T 2
4 32.075
0 0.4239 1.8478
The 0above coefficient matrix is tri-diagonal. Special
algorithms such as Thomas’ algorithm can be used
to solve simultaneous linear equation with tri-
diagonal coefficient matrices.The solution is given
by T 02
T 12 51.326
100
30.669 Hence, the nodal T1
2 51.326
T2
2
temps at t 6sec T2
2
T3
2 30.669
2
are
23.876
T42 22.836 T3
T 2 23.876
4 22.836
T52 25
3
Example 2: Implicit Method
Nodal temperatures when t 9sec , (Example
i T 3
100C
Calculations)
0 Boundary Condition
0 the interior nodes setting j 2 andi 1, 2,3, 4 gives the
For
ifollowing,
T 03 (1 )T13 T 23 12
1 2
(0.4239 T (1 2 0.4239)T 3 (0.4239T 3 )
100)
51.326
1
2
42.39 1.8478T 3 0.4239T 3 51.326
1 2
i 1.8478T 3
0.4239T 3
3 93.716
T 1 (1
3
1 2)T2 T 3 2 2
3 2
2 T
0.4239T 13 1.8478T 23 0.4239T 33
30.669
For the third time step we can write four such
equations with four unknowns, expressing them in
1.8478form
matrix yields
0.4239 0 3
0 T 1 93.716
0.4239 1.8478 0.4239 3
30.669
0 T 2
0 1.8478
0.4239 3
1.8478 T 43
33.434 4
Example 2: Implicit Method
1.8478 0.4239 0 0 13
0.4239 T 93.716
1.8478 0.4239 0 3 30.669
T2
0 1.8478
0.4239
3
1.8478 T43 33.434
0
The0 above coefficient matrix
0.4239 is tri-diagonal. Special
algorithms such as Thomas’ algorithm can be used
T 3 linear equation with tri-
to solve simultaneous
diagonal coefficient matrices.The solution is given
by T 3
23.876 100 0
59.043
T13 Hence, the nodal 13
T 59.043
3
36.292 0.4239
temps at t 9sec
T
2 3 T 23 36.292
3
are
T3
3 26.809 T3 26.809
T4 24.243
T 4 24.243
3
T53 25
41
Example 2: Implicit
Method
To better visualize the temperature variation at
different locations at different times, the
temperature distribution along the length of the
rod at different times is plotted below.
42
The Crank-Nicolson Method
WHY
:
2 T O(x)2
Using the implicit method our was
x2
approximation of T of
accuracy, while our approximation
t of was of
O(t) accuracy.
43
The Crank-Nicolson Method
2 T T j
i1
2Ti
j
Ti1
T j1
i1
2T j 1
i
T j 1
i1
jx2 x x
i, j 2
2 2
44
The Crank-Nicolson Method
Ti j1
T j
i
T t
i, j
t
45
The Crank-Nicolson Method
• Substituting these approximations into the
governing equation for heat conductance yields
Ti1j 2T ji T i1
j j 1
T i1 2T j i1 T j i1
1
Ti j 1 T ij
2
x x
t
2 2
givin
g
T i1j1 2(1 i
j1
T i1j1 Ti1j 2(1 )T i j Ti1j
)T
where
t
x
2
• Having rewritten the equation in this form
allows us to descritize the physical problem.We then
solve a system of simultaneous linear equations to find
the temperature at every node at any point in time.
46
Example 3: Crank-Nicolson
Consider a steel rod that is subjected to a temperature of 100C
on the left end and 25C on the right end. If the rod is of
length0.05m ,use the Crank- Nicolson method to find the
temperature distribution in the rod from t
0 to W J t
kg C
Given: k
9 seconds. mUse , 7800
K x 0.01m , t490
3s. kg K
m3
54
,
The initial temperature of the rod
is 20C .
i0 2 3 4 5
1 T 25
C
T 100 C 0.01m
47
Example 3: Crank-Nicolson
Recall, Number of time
steps,
k t final tinitial
C t
therefor 90
3
e,
54
7800 490
3.
1.4129 m /
2
Boundary
105 Conditions
s. T 0j
25C
100C forall j
Then, T 5j
0,1,2,3
t
3
All internal nodes are
x
1.4129
2 5
10 0.01 2
at 20C for t 0sec. This
can be represented as,
0.4239.
T i0 20C, for all i
1,2,3,4
48
Example 3: Crank-Nicolson
Nodal temperatures when t 0sec , j
0: T00 100C
T1 0
0
T2
20C C
Interior nodes
20
0
T3 C
T40 C
20
20
T0
5
25C
We can now form our system of equations for the first
time step by writing the approximated heat conduction
equation for each node.
T i1j1 2(1 i
j1
T i1j1 j
i1 2(1 )T i j Ti1j
)T T
49
Example 3: Crank-Nicolson
Nodal temperatures when t 3sec , (Example
iCalculations)
T01 100C Boundary Condition
0
For the interior nodes setting j 0 and i 1, 2,3, 4 gives the
following
T 01 2(1 )T11 T 21 T00 2(1 )T 10 20
i(0.4239
T 1 100) 2(1 0.4239)T 1 0.4239T 1 (0.4239)100 2(1 0.4239)20
1 2
(0.4239)20
42.39 2.8478T 1 0.4239T 1 42.39 23.044 8.478
1 2
are
T3 T3 23.174
2 23.174
T4 22.730 T 2 22.730
4
25
T52
5
Example 3: Crank-Nicolson
Nodal temperatures when t 9sec , (Example
i T 3
100C
Calculations)
0 Boundary Condition
For
0 the interior nodes setting j 2 and i 1, 2,3, 4 gives the
following,
i T13 2(1 )T 3 T 3 T02 2(1 )T 12 2
0 1 2 2
T
(0.4239 100) 2(1 0.4239)T2 3 0.4239T23
(0.4239)100 2(1 0.4239)55.883 (0.4239)31.075
42.39 2.8478T 3 0.4239T 3 42.39 64.388 13.173
1 2
0.4239
0 162.34
T1
2.8478 0.4239 3 69.318
0
T2
0 2.8478
0.4239
3
3
2.8478 T4 57.210
0
The 0 0.4239
above coefficient
matrix is tri-diagonal. Special
algorithms such as Thomas’
3
algorithm can be used
T linear equation with tri-
to solve simultaneous
diagonal coefficient matrices.The solution is given
by 100
49.509
T 03
62.604
T13 62.604 Hence, the nodal
3 temps
0.4239
at t 9sec
T13
T 37.613 T 37.613
3
T33 23
2
are
T
3 26.562
26.562
T43 24.042 T 3 24.042
4
25
T53
55
Example 3: Crank-
Nicolson
To better visualize the temperature variation at
different locations at different times, the
temperature distribution along the length of the
rod at different times is plotted below.
56
Internal Temperatures at
9 sec.
The table below allows you to compare the results
from all three
methods discussed in juxtaposition with the
analytical solution.
Crank-
Node Explicit Implicit Analytic
Nicolso
al
n
T3
1 65.953 59.043 62.604 62.510
3
T
2 39.132 36.292 37.613 37.084
3
T
3
3
27.266 26.809 26.562 25.844
T
4 22.872 24.243 24.042 23.610
57
Ada
Pertanyaan?
58