partial differential equations - carnegie mellon …scoros/cs15467-s16/lectures/08-pdes.pdf ·...
TRANSCRIPT
Recap
What does an ODE for exponential decay look like?
• It could be a very crude model for how the temperature of a particle changes through time…
• But where does the heat go? It’s a PDE!
4
Partial Differential Equations
5
PDEs: implicitly define a function through its derivatives with respect to time and space
Most physical phenomena and processes can be described by partial differential equations
Partial Differential Equations
ODEs: want to solve for function of time
PDEs: want to solve for function of time and space
7
txF
dt
txdm
2
2
Example ODE:
2
2 ,,
x
xtuc
t
xtu
Example PDE:
Partial Differential Equations
Definition of PDE
Function implicitly given in terms of derivatives
8
),( xtu
,,,3
udt
duu
,,,21
2
2
2
1 x
u
xx
u
x
u
Any combination of time derivatives
Plus any combination of space derivatives
Partial Differential Equations
Abbreviation
Linear vs non-linear PDEs
Order of a PDE: how many derivatives in space and time?
- wave equation: 2nd order in time, 2nd order in space
- Burger’s equation: 1st order in time, 2nd order in space
,..),(,..),(2
2
2
yxuyx
utut
u xytt
Nonlinear example
Burgers’ equation
xxxt uuuu
Linear example
wave equation
xxtt cuu
PDEs: a first example
A linear, first order PDE: 1D advection
10
Weather forecast: simulate temperature evolution.
T
x
cT0(x)
Given: initial temperature distribution 𝑇0 𝑥 = 𝑇 𝑥, 0 , wind speed c.
Find: temperature distribution 𝑇(𝑥, 𝑡) for any 𝑡, 𝑥.
One space dimension + time
PDEs: a first example
11
• How does the temperature change over a time interval
Dt?T
x
cT(x,t)
T(x,t+Dt)T(x-cDt,t)
cDt-cDt
At a given location in space, some time
later, what will the temperature be?
Where was this air front at time t?
PDEs: a first example
12
1D advection equation
• How does the temperature change over a time interval
Dt?
DT
x
Tc
t
T
0Dt
T
x
cT(x,t)
T(x,t+Dt)T(x-cDt,t) ),(),( txTttxTT DD
),(),( ttcxTttxT DD
)(),(),( 2tOtcx
TtxTttcxT DD
D
x
Tc
t
T
D
D
),( ttxT D
cDt-cDt
PDEs: a first example
Analytical solution:
• Want a function T(x,t) that satisfies
13
x
Tc
t
T
• The solution also needs to satisfy the initial condition:
)()0,( 0 xTxT
• The solution is thus )(),( 0 ctxTtxT
Note: only simple PDEs can be solved analytically!
)(),( ctxftxT • Any T(x,t) of the form will work! How do
we choose one of the many options?
14
PDEs: a first example
Numerical solution:
• Want to approximate function T(x,t) by discretizing in space and time (estimate T(x,t) at different (xi,ti))
T
x
t
PDEs: a first example
• Sample temperature T(x,t) on
• Discretize derivatives with finite differences (space & time)
h
iTiTctiTiT
tttt ]1[][
][][1 D• Solving for Tt+1[i]
yields update rule
• Provide initial values T0[i]
• Need some boundary conditions Tt[0]!
x
Tc
t
T
…]0[0T ][0 nT
…]0[1T
x
t),(][ tthiTiT t D
..)2,1,0(),,..,1( tni
1D grids
with
h
iTiTc
t
iTiT tttt ]1[][][][1
D
PDEs: a first example
Eulerian vs Lagrangian viewpoint
16
T
x
cT0(x)T
x
cT0(x)
…
Monitor temperature at
fixed locations in space
Release weather balloons and see
where they end up (the temperature
they record does not change)!
Basic Recipe for solving PDEs
numerically
Pick a spatial discretization
Pick a time discretization (forward Euler, backward Euler, etc)
Run a time-stepping algorithm using resulting update rule
We will see a few more examples…
17
Mathematical Background
Many, many types of PDEs
2nd order linear PDEs are most important for us
They involve the Laplace operator (“average” curvature)
• Nabla operator t
xx d
,...,
1
• Laplace operator D 22
2
1 k
d
kx
(in d dimensions)
st
x
s
x
s
d
,...,
1
PDE classification
19
• 2nd order linear PDEs are of highest practical
relevance dedicated classification
- Hyperbolic B2-AC > 0 (Wave equation)
- Parabolic B2-AC = 0 (Heat equation)
- Elliptic B2-AC < 0 (Laplace equation)
),,,,(2 yxyyxyxx uuuyxFCuBuAu
• A 2nd order linear PDE in 2 variables (x,y) has the form
• A 2nd order linear PDE in 2 variables is
Elliptic PDEs
Elliptic 2nd –order PDEs ( B2-AC < 0 ) describe static problems (systems in equilibrium)
Prototype: 0)( D xuLaplace Equation
Applications
• Steady-state solutions to parabolic PDEs
• Equilibrium problems
What is the smoothest function given boundary data? Think elastic membrane clamped at boundaries.
How do we solve it?
21
Laplace Equation
22
Laplace Equation
0),(),(),(2
2
2
2
D yxu
yyxu
xyxu
Discretizing on a grid with cell size h:
- Solution: each point must be equal to average of “neighbors”
- Can iteratively keep setting to average of neighbor values
(Jacobi method!) or set up a linear system. Very easy!
04
2
,1,1,,1,1
,
D
h
uuuuuu
jijijijiji
ji
Boundary Conditions
What happens at the “edges” of the simulation domain?
• Need additional information
• For ODEs, we had an initial value
• For PDEs, we also need boundary conditions
Two common choices:
• Dirichlet – boundary data specifies values
• Neumann – boundary data specifies derivatives
23
Boundary Conditions
Dirichlet Boundary Conditions:
Many possible functions! The Laplace equation gives the smoothest one.
24
ba )1(,)0(
Boundary Conditions
Neumann Boundary Conditions:
Again, many possible functions!
Some combinations of PDEs + boundary conditions may not have solutions!
25
vu )1(',)0('
Parabolic PDEs
Applications
• Heat conduction and general diffusion processes
Parabolic 2nd –order PDEs ( B2-AC = 0 ) Are typically time dependent problems
Solutions smooth out as time increases
Prototype: Heat Equation
thermal diffusivitytemperature,u
),(),( 2 tuct
tu xx D
The Heat Equation
How does an initial distribution of heat spread out over time? After a long enough time, solution is the same as the Laplace equation.
27
The Heat Equation
Know how to discretize the Laplacian
Know how to discretize time (e.g. forward Euler)
Can easily put the two together…
28
2
,1,1,,1,1
,
4
h
uuuuuu
jijijijiji
ji
D
n
ji
n
ji
n
ji utuu ,,
1
, DD
Hyperbolic PDEs
29
Hyperbolic 2nd –order PDEs ( B2-AC > 0 ) time dependent problems
Retain & propagate disturbances present in initial data
Prototype: ),(),(
2
2
2
tuct
tux
xD
Wave Equation
Applications
• Simulate wave propagation for sound, light, and
water
• Mechanics (oscillatory motion, vibrating strings)
c propagation speedamplitude,u