Professional Documents
Culture Documents
SE301 Topic9 Term071
SE301 Topic9 Term071
Topic 9
Partial Differential Equations
Dr. Samir Al-Amer
Term 071
١
813
Notation
∂ 2 u ( x, t )
u xx =
∂x 2
∂ 2 u ( x, t )
u xt =
∂x ∂t
order of the PDE = order of the highest order derivative
٢
813
Linear PDE
Classification
A PDE is linear if it is linear in the unknown
function and its derivatives
Example of linear PDE :
2 u xx + 1 u xt + 3 utt + 4 u x + cos(2t ) = 0
2 u xx + −3 ut + 4 u x = 0
Examples of Nonlinear PDE
2 u xx + (u xt ) + 3 utt = 0
2
u xx + 2 u xt + 3 ut = 0
2 u xx + 2 u xt ut + 3 ut = 0
SE301_Topic9 (c)Al-Amer 2005 ٥
t1 T=3.5
x1
Different curves are Three dimensional The axis represent
used for different plot of the function the independent
values of one of the T(x,t) variables. The value
independent
of the function is
variable
displayed at grid
points
SE301_Topic9 (c)Al-Amer 2005 ٦
٣
Heat Equation Different curve is
used for each
value of t
∂ 2 T ( x, t ) ∂ T ( x , t ) Position x
− =0
∂x 2 ∂t Temperature at
T (0, t ) = T (1, t ) = 0 different x at t=h
T ( x, o) = sin(π x)
Heat Equation
Temperature
T(x,t) Time t
ice ice
T ( x1 , t1 )
x
∂ 2 T ( x, t ) ∂ T ( x , t )
− =0 t1
∂x 2 ∂t
T (0, t ) = T (1, t ) = 0
x1 Position x
T ( x,0) = sin(π x)
٤
814
٥
Classification of PDE
Linear Second order PDE are important set of
equations that are used to model many systems
in many different fields of science and
engineering.
Examples of PDE
PDE are used to model many systems in
many different fields of science and
engineering.
Important Examples:
Q Wave Equation
Q Heat Equation
Q Laplace Equation
Q Biharmonic Equation
٦
Heat Equation
∂ 2 u ( x, y , z , t ) ∂ 2 u ( x, y , z , t ) ∂ 2 u ( x, y , z , t ) ∂ u ( x, y , z , t )
+ + =
∂x 2
∂y 2
∂z 2 ∂t
٧
Wave Equation
∂ 2 u ( x, y , z , t ) ∂ 2 u ( x, y , z , t ) ∂ 2 u ( x, y , z , t ) ∂ 2 u ( x, y , z , t )
+ + =
∂x 2 ∂y 2 ∂z 2 ∂t 2
Laplace Equation
∂ 2 u( x, y, z, t ) ∂ 2 u( x, y, z, t ) ∂ 2 u( x, y, z, t )
+ + =0
∂x 2 ∂y 2 ∂z 2
٨
Biharmonic Equation
∂ 4 u ( x, y , t ) ∂ 4 u ( x, y , t ) ∂ 4 u ( x, y , t )
+2 + =0
∂x 4 ∂x 2 ∂y 2 ∂y 4
٩
The solution Methods for PDE
S Analytic solutions are possible for simple
and special (idealized) cases only.
S To make use of the nature of the
equations, different methods are used to
solve different classes of PDE.
S The methods discussed here are based on
finite difference technique
Elliptic Equations
S Elliptic Equations
S Laplace Equation
S Solution
١٠
Elliptic Equations
A second order linear PDE (2 - indepent variables x , y)
A u xx + B u xy + C u yy + D = 0,
where D is a function of x, y, u x , u y
is Elliptic if B 2 − 4 AC < 0
Laplace Equation
Laplace equation appears is several
engineering problems such as
Q Studying the steady state distribution of
heat in a body
Q Studying the steady state distribution of
electrical in a body
∂ 2 T ( x, y) ∂ 2 T ( x, y)
+ = f ( x, y)
∂x 2 ∂y 2
T :steady state temperature at point (x, y)
f(x, y): heat source (or heat sink)
SE301_Topic9 (c)Al-Amer 2005 ٢٢
١١
Laplace Equation
∂ 2 T ( x, y) ∂ 2 T ( x, y)
+ = f ( x, y)
∂x 2 ∂y 2
A = 1, B = 0, C = 1
B 2 − 4 AC = −4 < 0 Elliptic
S Temperature is function of the position (x and y)
S When no heat source is available Âf(x,y)=0
Solution Technique
SA grid is used to divide region of interest
S Since the PDE is satisfied at each point in
the area, it must be satisfied at each point
of the grid.
S A finite difference approximation is
obtained at each grid point.
١٢
Solution Technique
∂ 2 T ( x, y) Ti +1, j − 2Ti , j + Ti −1, j
= ,
∂x 2 (∆x)2
∂ 2 T ( x, y) Ti , j +1 − 2Ti , j + Ti , j −1
=
∂y 2 (∆y )2
∂ 2 T ( x, y) ∂ 2 T ( x, y)
⇒ + =0
∂x 2 ∂y 2
is approximated by
Ti +1, j − 2Ti , j + Ti −1, j Ti , j +1 − 2Ti , j + Ti , j −1
+ =0
(∆x) 2
(∆y )2
SE301_Topic9 (c)Al-Amer 2005 ٢٥
Solution Technique
( Laplacian DifferenceEquation)
assume ∆x = ∆y = h
⇒ Ti +1, j − 4Ti , j + Ti −1, j + Ti , j +1 + Ti , j −1 = 0
SE301_Topic9 (c)Al-Amer 2005 ٢٦
١٣
Solution Technique
Ti , j +1
Ti −1, j Ti , j Ti +1, j
Ti , j −1
Example
It is required to determine the steady
state temperature at all points of a heated
sheet of metal. The edges of the sheet are
kept at constant temperature 100,50, 0
and 75 degrees. 100
75 50
١٤
Known
Example To be determined
Known
T1, 2 T2, 2
T0, 2 = 75
١٥
Example
T1, 4 = 100 T2, 4 = 100
T1,3 T2,3
T0,3 = 75
T1, 2 T2, 2
T0, 2 = 75
Known
١٦
Solution
The rest of the equations
⎛ 4 −1 0 −1 ⎞ ⎛ T11 ⎞ ⎛ 75 ⎞
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ −1 4 −1 0 −1 ⎟ ⎜ T21 ⎟ ⎜ 0 ⎟
⎜ 0 −1 4 0 0 −1 ⎟ ⎜ T ⎟ ⎜ 50 ⎟
⎜ ⎟ ⎜ 31 ⎟ ⎜ ⎟
⎜ −1 0 0 4 −1 0 −1 ⎟ ⎜ T12 ⎟ ⎜ 75 ⎟
⎜ −1 0 −1 4 −1 0 −1 ⎟ ⎜T ⎟ = ⎜ 0 ⎟
⎜ ⎟ ⎜ 22 ⎟ ⎜ ⎟
⎜ − 1 0 − 1 4 0 0 − 1⎟ ⎜ T32 ⎟ ⎜ 50 ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ − 1 0 0 4 − 1 0 ⎟ ⎜ T13 ⎟ ⎜175 ⎟
⎜ − 1 0 − 1 4 − 1⎟ ⎜ T23 ⎟ ⎜100 ⎟
⎜⎜ ⎟⎜ ⎟ ⎜ ⎟
⎝ − 1 0 − 1 4 ⎟⎠ ⎜⎝ T33 ⎟⎠ ⎜⎝150 ⎟⎠
١٧
Parabolic Equations
S Parabolic Equations
S Heat Conduction Equation
S Explicit Method
S Implicit Method
S Cranks Nicolson Method
Parabolic Equations
A second order linear PDE (2 - indepent variables x , y)
A u xx + B u xy + C u yy + D = 0,
where D is a function of x, y, u x , u y
is parabolic if B 2 − 4 AC = 0
١٨
Parabolic Problems
∂ 2 T ( x, t ) ∂ T ( x , t )
Heat Equation − =0
∂x 2 ∂t
T (0, t ) = T (1, t ) = 0
T ( x, o) = sin(π x) ice ice
* Parabolic problem ( B 2 − 4 AC = 0)
* Boundary conditions are needed to uniquely specify a solution
١٩
Finite Difference Methods
Replace the derivatives by finite difference formula [ T is function of x and t]
Central Difference Formulas :
∂ T ( x, t ) Ti +1, j − Ti −1, j
≈
∂x 2 ∆x
∂ 2 T ( x, t ) Ti +1, j − 2Ti , j + Ti −1, j
≈
∂x 2 ( ∆x ) 2
∂ 2 u ( x, t ) Ti , j +1 − 2Ti , j + Ti , j −1
≈
∂t 2 ( ∆t ) 2
Forward Difference Formula :
∂ T ( x, t ) Ti +1, j − Ti , j ∂ T ( x, t ) Ti , j +1 − Ti , j
≈ , ≈
∂x ∆x ∂t ∆t
SE301_Topic9 (c)Al-Amer 2005 ٣٩
٢٠
Solution of the PDE
∂ 2 T ( x , t ) ∂ T ( x, t )
Heat Equation − =0
∂x 2 ∂t t
T (0, t ) = T (1, t ) = 0
T ( x, o) = sin(π x)
Solution means x
٢١
Explicit Method
∂ 2 u ( x, t ) ∂ u ( x, t )
− =0
∂x 2 ∂t
u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) u ( x, t + k ) − u ( x , t )
2
=
h k
1
2
(u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) ) − 1 (u ( x, t + k ) + u ( x, t ) ) = 0
h k
k
Define σ = 2
h
u ( x, t + k ) = σ u ( x + h, t ) + (1 − 2 σ ) u ( x, t ) + σ u ( x − h, t )
Explicit Method
How do we compute
u ( x, t + k ) = σ u ( x + h, t ) + (1 − 2 σ ) u ( x, t ) + σ u ( x − h, t )
means
u(x,t+k)
٢٢
Explicit Method
How do we compute
u ( x, t + k ) = σ u ( x + h, t ) + (1 − 2 σ ) u ( x, t ) + σ u ( x − h, t )
means
Explicit Method
u ( x, t + k ) can be computed directly using
u ( x, t + k ) = σ u ( x + h, t ) + (1 − 2 σ ) u ( x, t ) + σ u ( x − h, t )
٢٣
Crank-Nicolson Method
∂ 2 u ( x, t ) ∂ u ( x, t )
− =0
∂x 2 ∂t
u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) u ( x , t ) − u ( x, t − k )
2
=
h k
1
2
(u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) ) − 1 (u ( x, t ) + u ( x, t − k ) ) = 0
h k
h2
Define s = , r = 2+ s
k
s u ( x, t − k ) = − u ( x − h, t ) + r u ( x, t ) − u ( x + h, t )
Explicit Method
How do we compute
su ( x, t − k ) = u ( x + h, t ) + r u ( x, t ) + u ( x − h, t )
means
u(x,t - k)
٢٤
Crank-Nicolson Method
The equation
s u( x, t − k ) = − u( x − h, t ) + r u( x, t ) − u( x + h, t )
can be expressed as a Tridiagonal system of equations
⎡ r −1 ⎤ ⎡ u1 ⎤ ⎡ b1 ⎤
⎢− 1 r − 1 ⎥ ⎢u ⎥ ⎢b ⎥
⎢ ⎥ ⎢ 2⎥ = ⎢ 2⎥
⎢ − 1 r − 1⎥ ⎢u3 ⎥ ⎢b3 ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣ − 1 r ⎦ ⎣u4 ⎦ ⎣b4 ⎦
Crank-Nicolson Method
٢٥
Outlines
S Examples
Q Explicit
method to solve Parabolic PDE
Q Cranks-Nicholson Method
Heat Equation
∂ 2 u ( x, t ) ∂ u ( x, t )
− =0
∂x 2 ∂t
u (0, t ) = u (1, t ) = 0
u ( x, o) = sin(π x) ice ice
* Parabolic problem ( B 2 − 4 AC = 0)
* Auxiliary conditions are needed to uniquely specify a solution
٢٦
Example 1
Solve the PDE
∂ 2u(x,t) ∂u(x,t)
− =0
∂2x ∂t
u (0, t ) = u (1, t ) = 0
u ( x,0) = sin(π x)
Example 1 (cont.)
∂ 2 u ( x, t ) ∂ u ( x, t )
− =0
∂x 2 ∂t
u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) u ( x, t + k ) − u ( x, t )
2
− =0
h k
16(u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) ) − 4(u ( x, t + k ) + u ( x, t ) ) = 0
u ( x, t + k ) = 4 u ( x + h, t ) − 7 u ( x, t ) + 4 u ( x − h, t )
٢٧
Example 1
u ( x , t + k ) = 4 u ( x + h, t ) − 7 u ( x , t ) + 4 u ( x − h, t )
t=1.0 0 0
t=0.75 0 0
t=0.5 0 0
t=0.25 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Example 1
u (0.25,0.25) = 4 u (.5,0) − 7 u (.25,0) + 4 u (0,0)
= 4 sin(π / 2) − 7 sin(π / 4) + 0 = −0.9497
t=1.0 0 0
t=0.75 0 0
t=0.5 0 0
t=0.25 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
٢٨
Example 1
t=1.0 0 0
t=0.75 0 0
t=0.5 0 0
t=0.25 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Remarks on Example 1
The obtained results are probably not accurate
because 1 − 2σ = −7
Let k = 0.025
٢٩
Example 1
t=0.10 0 0
t=0.075 0 0
t=0.05 0 0
t=0.025 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Example 1
u (0.25,0.025) = 0.4 u (0.5,0) + 0.2 u (0.25,0) + 0.4 u (0,0)
= 0.4 sin(π / 2) + .2 sin(π / 4) + 0 = 0.5414
t=0.10 0 0
t=0.075 0 0
t=0.05 0 0
t=0.025 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
٣٠
Example 1
u (0.5,0.025) = 0.4 u (0.75,0) + 0.2 u (0.5,0) + 0.4 u (0.25,0)
= 0.4 sin(3π / 4) + .2 sin(π / 2) + 0.4 sin(π / 4) = 0.7657
t=0.10 0 0
t=0.075 0 0
t=0.05 0 0
t=0.025 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Example 2
Solve the PDE
∂ 2u(x,t) ∂u(x,t)
− =0
∂2x ∂t
u (0, t ) = u (1, t ) = 0
u ( x,0) = sin(π x)
٣١
Example 2
Crank-Nicolson Method
∂ 2 u ( x, t ) ∂ u ( x, t )
− =0
∂x 2 ∂t
u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) u ( x, t ) − u ( x, t − k )
2
=
h k
16(u ( x + h, t ) − 2u ( x, t ) + u ( x − h, t ) ) − 4(u ( x, t ) − u ( x, t − k ) ) = 0
h2
Define s = = 0.25, r = 2 + s = 2.5
k
0.25 u ( x, t − k ) = − u ( x − h, t ) + 2.5 u ( x, t ) − ( x + h, t )
u ( x, t − k ) = − 4 u ( x − h, t ) + 10 u ( x, t ) − 4( x + h, t )
SE301_Topic9 (c)Al-Amer 2005 ٦٣
Example 2
Crank-Nicolson Method
∂2 u(x, t) ∂ u(x, t)
− =0
∂x2 ∂ t
u(x + h, t) − 2u(x, t) + u(x − h, t) u(x, t) − u(x, t − k)
=
h2 k
16(u(x + h, t) − 2u(x, t) + u(x − h, t)) − 4(u(x, t) − u(x, t − k)) = 0
h2
Define s = = 0.25, r = 2 + s = 2.25
k
0.25u(x, t − k) = −u(x − h, t) + 2.25 u(x, t) −(x + h, t)
SE301_Topic9 (c)Al-Amer 2005 ٦٤
٣٢
Example 2
t=1.0 0 0
t=0.75 0 0
t=0.5 0 0
u1 u2 u3
t=0.25 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Example 2
t=1.0 0 0
t=0.75 0 0
t=0.5 0 0
u1 u2 u3
t=0.25 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
٣٣
Example 2
t=1.0 0 0
t=0.75 0 0
t=0.5 0 0
u1 u2 u3
t=0.25 0 0
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Example 2
Crank-Nicolson Method
٣٤
Example 2
Second Row
t=1.0 0 0
t=0.75 0 0
u1 u2 u3
t=0.5 0 0
t=0.25 0 0
0.2115 0.2991 0.2115
t=0 0 0
Sin(0.25π) Sin(0. 5π) Sin(0.75π)
Example 2
٣٥
Remarks
The explicit metod:
• one need to select small k to ensure stability
• Computation per point is very simple but many
points are needed.
Cranks Nicolson
• Requires solution of Tridiagonal system
• Stable (larger k can be used).
SE301_Topic9 (c)Al-Amer 2005 ٧١
٣٦