MIT2 29F11 Lect 12
MIT2 29F11 Lect 12
MIT2 29F11 Lect 12
• FINITE DIFFERENCES
– Classification of Partial Differential Equations (PDEs) and examples
with finite difference discretizations
• Parabolic PDEs
• Elliptic PDEs
• Hyperbolic PDEs
Hyperbolic
Parabolic
Elliptic
n(x,y1)
(Only valid for two independent variables: x,y)
x
• In general: A, B and C are function of: x, y , , x , y
• Equations may change of type from point to point if A, B and C vary with x, y, . etc
• Navier-Stokes, incomp., const. viscosity: Du u (u ) u 1 p 2 u g
Dt t
2.29 Numerical Fluid Mechanics PFJL Lecture 12, 4
4
Partial Differential Equations
ELLIPTIC: B2 - 4 A C < 0
y
n(x,y2)
Quasi-linear PDE for ( x, y )
Hyperbolic
Parabolic
Elliptic
n(x,y1)
Poisson Equation
• Potential Flow with sources
• Heat flow in plate
Convection-Diffusion
Discretization
u0,y)=g1(y) ua,y)=g2(y)
j+1
j
j-1
Finite Differences
i-1 i i+1
u(x,0) = f1(x) x
u(x,b) = f2(x)
Finite Difference Scheme
Boundary Conditions
u0,y)=g1(y) ua,y)=g2(y)
j+1
j
j-1
i
i
i-1 i i+1
Global Solution Required u(x,0) = f1(x) x
Poisson Equation
9
Partial Differential Equations
Hyperbolic PDE: B2 - 4 A C > 0
Examples: 2u 2 u
2
(1) c Wave equation, 2nd order
t 2 x 2
u u
Wave Solutions
u(x,0), ut(x,0) x
t 2 x 2
Discretization:
i-1 i i+1
u(x,0), ut(x,0) x
Finite Difference Representations
u0,t) uL,t)
j+1
j
j-1
Stability Requirement:
i-1 i i+1 x
c t u(x,0), ut(x,0)
C 1 Courant-Friedrichs-Lewy condition (CFL condition)
x
Physical wave speed must be smaller than the largest numerical wave speed, or,
Time-step must be less than the time for the wave to travel to adjacent grid points:
x x
c or t
t c
2.29 Numerical Fluid Mechanics PFJL Lecture 11, 13
13
Error Types and Discretization Properties:
Consistency
Lˆx ( ) x
– The truncation error acts as a source for the discretization error, which is
convected and diffused by the operator Lˆx
2.29 Numerical Fluid Mechanics PFJL Lecture 12, 15
15
Error Types and Discretization Properties:
Stability
Stability
– A numerical solution scheme is said to be stable if it does not amplify
Convergence
Convergence
– A numerical scheme is said to be convergent if the solution of the
discretized equations tend to the exact solution of the (P)DE as the grid-
spacing and time-step go to zero
– Error equation for linear(-ized) systems: Lˆx ( x )
1
φ
get closer to xi
Exact Central
Backward Forward
Rn f ( )
n 1!
• Estimate the second-derivative with forward finite-differences at first-
order accuracy:
x 2
f ( xi1 ) f ( xi ) x f '(xi ) f ''(xi ) O( x 3 )
2! * ( 2) f ( xi2 ) 2 f ( xi1 ) f ( xi )
f ''(xi ) O(x)
4x 2 3 * (1) x 2
f (xi2 ) f (xi ) 2x f '(xi ) f ''(xi ) O(x )
2!
f ( xi1 ) f ( xi ) x
f '( xi )
f ''(xi ) O( x 2 )
x 2!
f ( xi 1 ) f ( xi ) x f ( xi 2 ) 2 f ( xi 1 ) f ( xi ) f ( xi 2 ) 4 f ( xi 1 ) 3 f ( xi )
f '( xi ) O ( x 2
) O ( x 2 )
x 2! x 2
2x
Forward
Differences
• Approach:
– Incorporate more higher-order terms of the Taylor series expansion
than strictly needed and express them as finite differences themselves
– e.g. for finite difference of mth derivative at order of accuracy p, express
the m+1th, m+2th, m+p-1th derivatives at an order of accuracy p-1, .., 2, 1.
– General approximation: mu s
m ai u ji x
x j i r
– Can be used for forward, backward, skewed or central differences
– Can be computer automated
– Independent of coordinate system and extends to multi-dimensional
finite differences (each coordinate is usually treated separately)
• Remember: order p of approximation indicates how fast the error is
reduced when the grid is refined (not the magnitude of the error)
f '( xi )
xi1 xi (xi xi1 )
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.