View
219
Download
2
Embed Size (px)
Citation preview
Partial differential equations
Function depends on two or more independent variables
0
y
u
x
u
This is a very simple one - there are many more complicated ones
1252
2
2
3
yu
x
ux
yx
u
Order of the PDE is given by its highest derivative
xyx
u
y
u
yx
u4
2
2
2
2
22
4
is 2nd order
xyx
u
yx
u
y
u42
2
22
2
2
is 4th order
Linear PDE is linear in dependent variable, and all coefficients depend on independent variables only
222
2
3
3
4 yxx
uy
y
ux
Nonlinear PDEs violate these rules
14 222
2
2
2
3
3
uyxx
uy
y
uxu
PDE that often appears in engineering is second order, linear PDE
General form:
02
22
2
2
Dy
uC
yx
uB
x
uA
A, B, C are functions of x and y
D is function of x,y,u and andx
u
y
u
Can use values of coefficients A,B,C to characterize the PDE
B2-4AC Type Example
<0 Elliptic Laplaceequation
=0 Parabolic Heatconduction
>0 Hyperbolic Waveequation
02
2
2
2
y
T
x
T
2
2
x
Tk
t
T
01
2
2
22
2
t
y
cx
y
Why categorize?
Different methods to solve different types
Different types describe different engineering problems
• Elliptic - steady state
• Parabolic - propagation
• Hyperbolic - vibrations
Analytic solutions - there aren’t many
Often can use analytic tools to get idea of behavior of a PDE, especially as parameters are changed
Important for limiting cases
Elliptic PDEs
Steady-state two-dimensional heat conduction equation is prototypical elliptic PDE
02
2
2
2
y
T
x
T
This is the Laplace equation
yxfy
T
x
T,
2
2
2
2
This is the Poisson equation
Think of a small box
qx, in
qy, out
qx, out
qy, in
At steady state, net change in heat is 0, so
0,,,, outyinyoutxinx qqqq
Shrink to differential size
0
y
q
x
q
Fourier’s law of heat conduction
a
TCkq pa
Substitute
02
2
2
2
y
T
x
T
0
y
TCk
yx
TCk
x pp
We will solve with finite differences
Discretize PDE so that we have a mesh of grid points with boundary conditions
0
1
2
3
4
5
6
7
8
9
10
0 1 2 3 4 5 6 7 8 9 10
Index for x is i
Index for y is j
Use finite differences for the derivatives
2
,1,,1
2
2 2
x
TTT
x
T jijiji
0
1
2
3
4
5
6
7
8
9
10
0 1 2 3 4 5 6 7 8 9 10
Ti-1,j
Ti,j
Ti+1,j
Now the y derivative
2
1,,1,
2
2 2
y
TTT
y
T jijiji
0
1
2
3
4
5
6
7
8
9
10
0 1 2 3 4 5 6 7 8 9 10
Ti,j+1
Ti,j
Ti,j-1
Substitute these expressions back into original elliptic PDE
022
2
1,,1,
2
,1,,1
y
TTT
x
TTT jijijijijiji
Assume x=y. Can rearrange to get
04 ,1,1,,1,1 jijijijiji TTTTT
True for all interior points
0
1
2
3
4
5
6
7
8
9
10
0 1 2 3 4 5 6 7 8 9 10
Need to define values on ALL boundaries - Dirichlet boundary condition
(Neumann BC fix flux at boundary)
Each interior point has an equation - for 9 x 9 interior points - 81 equations
Adds up quickly
Example: 4 x 4 grid - 2 x 2 interior points
0
1
2
3
0 1 2 3
75
20
10
02550
60 45 30
75
75
75
1354
046075
04
1,12,11,2
1,12,11,2
1,10,12,11,01,2
TTT
TTT
TTTTT
0
1
2
3
0 1 2 3
75
20
10
02550
60 45 30
75
75
75
Let i=1, j=1
Fill in the matrix
35
65
125
135
411
141
141
114
2,2
1,2
2,1
1,1
T
T
T
T
Generally, we get a sparse matrix (big, too)
Technique most often used is Gauss-Seidel or some variation of it - matrix is always diagonally dominant - also called Liebmann’s rule
Apply these steps iteratively until T converges
41,1,,1,1
,
jijijijiji
TTTTT
Rewrite equation in Gauss-Seidel form
04 ,1,1,,1,1 jijijijiji TTTTT
Use overrelaxation (if desired)
oldji
newji
newji TTT ,,, 1
Solving our example - the four equations are
0
1
2
3
0 1 2 3
75
20
10
02550
60 45 30
75
75
75
0654
01354
2,12,21,1
1,11,22,1
TTT
TTT
0354
01254
2,21,22,1
1,22,21,1
TTT
TTT
Rewrite them in Gauss Seidel form
4
354
1254
654
135
1,22,12,2
2,21,11,2
2,21,12,1
1,22,11,1
TTT
TTT
TTT
TTT
and assume initial values for T
75
75
75
75
2,2
1,2
2,1
1,1
T
T
T
T
Run without overrelaxation
iterationstart 1 2 3 4 5 6 7 8 9T11 75 71.25 64.38 60.31 58.59 57.58 57.15 56.89 56.79 56.72T12 75 53.75 45.63 42.19 40.16 39.3 38.79 38.57 38.45 38.39T21 75 68.75 60.63 57.19 55.16 54.3 53.79 53.57 53.45 53.39T22 75 46.25 39.38 35.31 33.59 32.58 32.15 31.89 31.79 31.72ea1 0.053 0.107 0.067 0.029 0.018 0.008 0.004 0.002 0.001ea2 0.395 0.178 0.081 0.051 0.022 0.013 0.006 0.003 0.001ea3 0.091 0.134 0.06 0.037 0.016 0.009 0.004 0.002 0.001ea4 0.622 0.175 0.115 0.051 0.031 0.013 0.008 0.003 0.002
0
10
20
30
40
50
60
70
80
0 2 4 6 8 10 12
T11
T12
T21
T22
0
1
2
3
0 1 2 3
75
20
10
02550
60 45 30
75
75
75
End result
56.72 38.39
31.7953.39
What about derivative (flux) boundary conditions
I.E. if we insulate one side of the plate, is 0 there
x
T
Create an imaginary point outside boundary
T0,j+1
T-1,j T1,jT0,j
T0,j-1
Equation becomes
04 ,0,1,11,01,0 jjjjj TTTTT
Now consider finite difference for derivative at 0
0,1,1
,1,1
0
2
2
t
TxTT
x
TT
t
T
jj
jj
Substitute
042 ,00
,1,11,01,0
jjjjj Tt
TxTTTT
Derivative BC now included in equation
Irregular domains (funny shapes)
What do you do with a domain like?
Your book uses , to scale the x, y
Different x, y
0
1
2
3
4
5
0 1 2 3 4 5
1 x
2 x
1 y
2 y
Can develop equations for edge points
02
2
212
,1,
211
,1,
2
212
,,1
211
,,
2
jijijiji
jijijijii
TTTT
y
TTTT
x
Now use a Gauss-Seidel or other matrix approach