Professional Documents
Culture Documents
Solution of Partial Differential Equations (Pdes)
Solution of Partial Differential Equations (Pdes)
resolucin
v = (u, v, w), T, p, = 1/ y q
1/t
Condicin inicial
H+0
D+0
sbado 15/12/2007 00
H+24
D+1
D+2
D+3
D+4
D+5
5
2u
2u
A 2 +B
+C 2 +D =0
xy
x
y
u(x,y), A(x,y), B(x,y), C(x,y), and D(x,y,u,,)
The PDE is nonlinear if A, B or C include u, u/x or u/y,
or if D is nonlinear in u and/or its first derivatives.
Classification
B2 4AC < 0 > Elliptic
(e.g. Laplace Eq.)
B2 4AC = 0 > Parabolic
(e.g. Heat Eq.)
B2 4AC > 0 > Hyperbolic (e.g. Wave Eq.)
Each category describes different phenomena.
Mathematical properties correspond to those phenomena.
7
u
u
(in terms of
u(x, y),
and
u
)
y
Laplace Eq.
u u
2u
+
=
u u
2
2 D(x, y, u,
, ) Poisson Eq.
x
y
x y
A = 1, B = 0, C = 1
Elliptic PDEs
Neumann:
in normal direction)
Mixed:
Elliptic PDEs
u(x,y =1) or u/y given on boundary
u(x=0,y)
or
u/x
given
on
boundary
Estimate
u(x)
from
Laplace
Equations
u(x=1,y)
or
u/x
given
on
boundary
x
10
Parabolic PDEs
Parabolic Equations (B2 4AC = 0) [first derivative in time ]
variation in both space (x,y) and time, t
typically provided are:
initial values:
u(x,y,t = 0)
boundary conditions:
u(x = xo,y = yo, t) for all t
u(x = xf,y = yf, t) for all t
11
Parabolic PDEs
Parabolic Equations (B2 4AC = 0)
A = k, B = 0, C = 0 > B2 4AC = 0
2u 2u
u u
u
2D :
= k 2 + 2 + D(x, y, u, , )
x y
t
y
x
= k 2u + D
12
Parabolic PDEs
u(x=0,t)
given
t
on
boundary
for all t
Estimate
u(x,t)
from
the Heat
Equation
u(x=1,t)
given
on
boundary
for all t
x
13
Parabolic PDEs
c(x,t) = concentration
at time, t, and distance, x.
x=0
x=L
Parabolic PDEs
x=0
x=L
c
c(x)
c(x)
V
= Q c(x) Q c(x) +
x D A
t
x
x
Flow in
Flow out
Dispersion in
c(x) c(x)
+ DA
+
x k V c(x)
x x
x
Decay
Dispersion out
reaction
As t and x ==> 0
c
c
2c Q c
==>
=D 2
kc
A x
t
t
x
15
Hyperbolic PDEs
Hyperbolic Equations (B2 4AC > 0)
16
Hyperbolic PDEs
[2nd derivative in time]
2u
x
1 2u
2
c t
+ D(x, y, u,
u u
x t
)=0
Models
vibrating string
water waves
voltage change in a wire
17
Hyperbolic PDEs
u(x=0,t)
given
t
on
boundary
for all t
Estimate
u(x,t)
from
the Wave
Equation
u(x=1,t)
given
on
boundary
for all t
Methods
Finite Difference (FD) Approaches (C&C Chs. 29 & 30)
u u
u u
+
=
x y
2
20
=
=
u i 1, j 2u i, j + u i +1, j
( x ) 2
u i, j1 2u i, j + u i, j+1
( y) 2
+ O( x 2 )
+ O( y 2 )
u
x
u
y
u i 1, j + u i +1, j + u i, j1 + u i, j+1 4u i, j
+ O(h 2 )
Elliptical PDEs
The Laplace Equation
=0
j+1
j-1
If x = y then
i-1
i+1
Elliptical PDEs
The Laplace molecule: Ti+1, j + Ti1, j + Ti, j+1 + Ti, j1 4Ti, j = 0
T = 100o C
T = 0o C
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
T = 100o C
T = 0o C
T11
T12
T13
T21
T22
-4
1
0
1
0
0
0
0
0
1
-4
1
0
1
0
0
0
0
0
1
-4
0
0
1
0
0
0
1
0
0
-4
1
0
1
0
0
0
1
0
1
-4
1
0
1
0
T23
0
0
1
0
1
-4
0
0
1
T31
0
0
0
1
0
0
-4
1
0
T32
0
0
0
0
1
0
1
-4
1
T33
0 T11 -100
0 T12 -100
0 T13 -200
0 T21 0
0 T22 = 0
1 T23 -100
0 T31 0
1 T32 0
-4 T33 -100
Excel
23
T Ti+1, j Ti1, j
T Ti, j+1 Ti, j1
x
y
2x
2y
then obtain resultant flux and direction:
qy
2
2
1
qn = qx + q y
= tan
qx > 0
qx
1 q y
= tan +
qx < 0
qx
(with in radians)
24
T = 0o C
28.6
50
14.3 28.6
T = 0o C
71.4
50
T = 100o C
Ti +1, j Ti1, j
T
k
q x = k
x
2x
Ti, j+1 Ti, j1
T
k
q y = k
y
2y
k' = 0.49 cal/scmC
1 0.875
o
o
o
= tan = tan
=
+
=
35.5
180
215.5
1.225
qx
25
If given
T
x
then use
to obtain
T T1, j Ti 1, j
=
x
2 x
T1, j = T1, j 2 x
T
x
T
+ T0, j+1 + T0, j1 4 T0, j = 0
x
Irregular boundaries
use unevenly spaced molecules close to edge
use finer mesh
26
T = 75o C
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
T T3,1 - T5,1
=
y
2y
T = 50o C
T
T5,1 = T3,1 2y
y
Insulated ==> T/ y = 0
Substitute into:
To obtain:
T
T4,2 T4,0 + 2T3,1 2y
4T4,1 = 0
y
0
27
28
1D
T
2T
=k 2
t
x
Find T(x,t)
2T 2T
T
2D
= k 2 + 2
Find T(x,y,t)
t
y
x
Given the initial temperature distribution
as well as boundary temperatures with
k'
= Coefficient of thermal diffusivity
k=
C
k' = coefficient of thermal conductivity
where: C = heat capacity
= density
29
2T
x 2
y2
T
t
Finite
Differences
30
Time derivative:
31
Express a future state, Tim+1, only in terms of the present state, Tim
T
2T
1-D Heat Equation:
=k
t
x 2
2 T Tim1 2Tim + Tim+1
2
=
+
O(
x)
Centered FDD
2
2
x
(x)
T Tim+1 Tim
=
+ O(t)
Forward FDD
t
t
Solving for Tim+1 results in:
with = k t /(x)2
10
t = 5 10
10
t = 4 10
10
t = 3 10
10
t = 2 10
10
t=1
t=0
10
10
10
10
15
20
15
10
Initial temperature
10
10
33
100 C
X=0
t
Heat Eqn.
Example
0 C
50 C
X = 10 cm
)
34
Left
Bndry
100C
26.2
13.1
Right
Bndry
50C
t=0
0 C
Initial temperature
T11 = T10 + (T00 2T10 +T20 ) = 0 + 0.262[1002(0)+0] = 26.2
T21 = T20 + (T10 2T20 +T30 ) = 0 + 0.262[02(0)+0] = 0
T31 = T30 + (T20 2T30 +T40 ) = 0 + 0.262[02(0)+50] = 13.1
36
Left
Bndry
100C
13.1
Right
Bndry
50C
t=0
0 C
Initial temperature
T12 = T11 + (T01 2T11 +T21 ) = 26.2 + 0.262[1002(26.2)+0] = 38.7
T22 = T21 + (T11 2T21 +T31 ) = 0 + 0.262[26.22(0)+13.1] = 10.3
T32 = T31 + (T21 2T31 +T41 ) = 13.1 + 0.262[02(13.1)+50] = 19.3
37
For the 1-D spatial problem, the following is the stability condition:
1
(x) 2
=
or
t
2
2
2k
(x)
1/2
can still yield oscillation (1D)
1/4
ensures no oscillation (1D)
= 1/6
tends to optimize truncation error
kt
39
40
T
2T
=k
t
x 2
2T
x
+ O(x) 2
T Tim+1 Tim
=
+ O(t)
t
t
Centered FDD
Backward FDD
with = k
(x) 2
1. Requires I.C.'s for case where m = 0: i.e., Ti0 is given for all i.
2. Requires B.C.'s to write expressions @ 1st and last interior
nodes (i=0 and n+1) for all m.
41
10
t = 5 10
10
t = 4 10
10
t = 3 10
10
t = 2 10
10
t=1
t=0
10
10
10
10
15
20
15
10
Initial temperature
10
10
42
m+1
m
i-1
i+1
m +1
m
i-1
i+1
with = k
t
(x)
for both
43
Right
Bndry
50C
Left
Bndry
100C
t=0
0 C
Initial temperature
At the Left boundary:
T11
m = 0; t = 0
Let = 0.4
T21
T31
0 C
Initial temperature
T41
Right
Bndry
50C
1
0 T1 40
1.8 -0.4 0
-0.4 1.8 -0.4 0 T 1 0
2 =
0 -0.4 1.8 -0.4 T 1 0
3
0
0
-0.4
1.8
T 1 20
4
T11
27.6
T21 6.14
1 =
T3 4.03
1 12.0
T4
40
0
0
20
45
T12
m = 0; t = 0
Let = 0.4
23.6
T22
6.14
T3
4.03
0 C
Initial temperature
T4
12.0
Right
Bndry
50C
2
0 T1 78.5
1.8 -0.4 0
-0.4 1.8 -0.4 0 T 2 6.14
2 =
3
0 -0.4 1.8
32.0
2
0
T4
T12
38.5
T22 14.1
2=
T3 9.83
2 20.0
T4
2
78.5
6.14
4.03
32.0
46
2T
x 2
2
2
2
(x)
(x)
T Tim+1 Tim
=
+ O(t 2 )
t
t
xi
xi+1
Left
Bndry
100C
Right
Bndry
50C
0 C
Initial temperature
Tim1+1 + 2(1 + )Tim +1 Tim+1+1 = Tim1 + 2(1 )Tim Tim+1
Crank-Nicolson
48
49
a = k 2
T(x, t) = e
k2 t
sin(x)
Stability Analysis
Consider FD schemes as advancing one step with a
"transition equation":
{Tm+1} = [A] {Tm}
with
{ }
Stability Analysis
{Tm } = [A]m{T0}
Stability Analysis
Illustration of Instability of Explicit Method (for a simple case)
or
r=14
+1
m+1
m+1
m
Tim
+
(1
+
2
)T
T
=
T
i
i +1
i
1
i
Tim = r m ( 1)
r m+1 ( 1)
i +1
+ (1 2 ) r m+1 ( 1) r m+1 ( 1)
= r m ( 1)
r [ (1)1 + (1 + 2) (1)+1] = 1
or
r = 1/[1 + 4 ]
i.e.,
54
)T
T
=
T
+
2(1
)T
+
T
1
i
i+1
i1
i
i+1
Tim = r m ( 1)
r m+1 ( 1)
i +1
+ 2 (1 + ) r m+1 ( 1) r m+1 ( 1)
r
i 1
( 1)
+ 2 (1 ) r
=
i
( 1)
+ r
i +1
( 1)
r = [1 2 ] / [1 + 2 ]
i.e.,
r(explicit)
r(implicit)
r(C-N)
analytical
0.50
0.00
0
0.25
0.5
0.75
1.25
-0.50
-1.00
56
or t
Explicit, 1-D Spatial: =
2
2
2k
(x)
1/2
can still yield oscillation (1D)
1/4
ensures no oscillation (1D)
= 1/6
tends to optimize truncation error
kt
h2
h2
or t
4k
(h = x = y)
57
2T 2T
T
= k 2 + 2
x
t
y
Explicit solutions :
Stability criterion
Find T(x,y,t)
(x) 2 + (y)2
t
8k
if h = x = y ==>
kt
h
or
h2
t
4k
58
first direction
second direction
59
Explicit
Implicit
yi+1
yi
yi-1
xi-1
yi+1
yi
yi-1
xi-1
t+1/2
xi
xi+1
t
xi
xi+1
first half-step
second half-step
ADI example
60