Numerical Solution of Partial Differential Equations Praveen. C [email protected]Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in 31 January 2009 Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 1 / 40
40
Embed
Numerical Solution of Partial Differential Equationsmath.tifrbng.res.in/~praveen/slides/pde1.pdfHyperbolic PDE Wave A phenomenon in which some recognizable feature propagates with
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Numerical Solution of Partial Differential Equations
We have N equations for the N unknowns: [u1, u2, . . . , uN ]
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 15 / 40
FDM for ODE• Matrix Ah is invertible
=⇒ Solution to discrete problem exists• Efficient solution using Thomas Tri-diagonal algorithm
0 1 2 3 4 5 6−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
x
u(x)
NumericalExact
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 16 / 40
Partial Differential Equations
• Problems involving more than one independent variableu(x, t): x is space, t is timeu(x, y): x, y denotes two space coordinatesu(x, y, t): x, y denotes two space coordinates, t is time=⇒ Leads to Partial Differential Equation
• One space and one time: u(x, t)I Hyperbolic equation
∂2u
∂t2= c2
∂2u
∂x2
I Elliptic equation∂u
∂t= µ
∂2u
∂x2
I Parabolic equation∂u
∂t+ c
∂u
∂x= µ
∂2u
∂x2
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 17 / 40
Simplest hyperbolic PDE
• Linear, scalar, convection (advection) equation for u(x, t)
∂u
∂t+ c
∂u
∂x= 0, x ∈ R
with initial conditionu(x, 0) = u0(x)
• Exact solutionu(x, t) = u0(x− ct)
x
u
t = 0 t = ∆t
c∆t
c > 0
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 18 / 40
Hyperbolic PDE
Wave
A phenomenon in which some recognizable feature propagates with arecognizable speed
Hyperbolic PDE
A PDE which has wave-like solutions
• Waves propagate in specific directions:
• Linear, convection equation
I c > 0 =⇒ wave moves to the rightI c < 0 =⇒ wave moves to the leftI c is the speed at which waves propagateI Finite speed of propagationI Preserves shape of initial condition
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 19 / 40
Hyperbolic PDE• Scalar, convection equation(
∂
∂t+ c
∂
∂x
)u = 0
contains one wave• Second order wave equation
∂2u
∂t2= c2
∂2u
∂x2
I can be factored (∂
∂t+ c
∂
∂x
)(∂
∂t− c ∂
∂x
)u = 0
I contains two waves, with speed +c and −cI In fact, general solution is
u(x, t) = f(x− ct) + g(x+ ct)
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 20 / 40
Elliptic PDE
• Example: Heat equation
∂u
∂t= µ
∂2u
∂x2, x ∈ R
with initial conditionu(x, 0) = u0(x)
∆ tt+
t
• No waves; initial condition is damped or dissipated
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 21 / 40
Parabolic PDE
• Convection-diffusion equation
∂u
∂t+ c
∂u
∂x= µ
∂2u
∂x2
contains convection and diffusion
∆ tt+t
• Damped wave-like solutions
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 22 / 40
FDM for ut + cux = 0
• Given u(x, 0) = u0(x), find solution for t > 0: Initial Value Problem
• Space-time grid
x
t
i
n
∆x
∆t
• Numerical solution uni
uni ≈ u(xi, t
n)
Numerical solution computed only at grid points
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 23 / 40
FDM for ut + cux = 0
• Forward difference in time
∂
∂tu(xi, t
n) ≈un+1
i − uni
∆t
• Three choices for ∂∂x
1 Backward difference
∂
∂xu(xi, t
n) ≈un
i − uni−1
∆x
2 Forward difference
∂
∂xu(xi, t
n) ≈un
i+1 − uni
∆x
3 Central difference
∂
∂xu(xi, t
n) ≈un
i+1 − uni−1
2∆x
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 24 / 40
FDM for ut + cux = 0
• Forward-time and backward-space finite difference scheme
∂u
∂t+ c
∂u
∂x= 0
approximated as
un+1i − un
i
∆t+ c
uni − un
i−1
∆x= 0
• Re-arranging
un+1i = un
i −c∆t∆x
(uni − un
i−1)
• Given initial condition u0i for all i, we march forward in time
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 25 / 40
FDM for ut + cux = 0• Three numerical schemes
1 Backward difference
un+1i = un
i − ν(uni − un
i−1)
2 Forward difference
un+1i = un
i − ν(uni+1 − un
i )
3 Central difference
un+1i = un
i −12ν(un
i+1 − uni−1)
• Courant-Friedrich-Levy number or CFL number
ν =c∆t∆x
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 26 / 40
FDM for ut + cux = 0
• Consider the case c > 0, ν = 0.8• Initial condition with a step
x
u
t = 0
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 27 / 40
FDM for ut + cux = 0
x
u
x
u
x
u
Backward Forward Central
Praveen. C (TIFR-CAM) Numerical PDE Jan 31, 2009 28 / 40
FDM for ut + cux = 0
• For stable schemes: ‖un‖ remains bounded
• For unstable schemes: ‖un‖ → ∞ as n→∞• For c > 0