View
190
Download
0
Category
Preview:
Citation preview
Differences Among Difference Schemes
NUMERICAL METHODS FOR PDES
Will iam L. Ruys
Objectives • Understand the classification of Second Order Linear
PDEs• Understand the Finite Difference Methods• How to discretize an equation• How to analyze convergence
• Implement and Analyze Schemes for• A Parabolic PDE: 1D Heat-Diffusion Equation• An Elliptic PDE: Laplace’s Equation 𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
Second Order Linear PDEs
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
+E
• Evolution with DiffusionParabolic
• Steady StateElliptic
• Evolution with ConservationHyperbol
ic
Finite Difference ApproximationsFORWARD DIFFERENCEBACKWARD DIFFERENCE
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
SECOND ORDER CENTERED DIFFERENCE
𝜕𝑢𝑖 , 𝑗
𝜕 𝑥 =𝑢𝑖+1 , 𝑗−𝑢𝑖 , 𝑗
Δ𝑥𝜕𝑢𝑖 , 𝑗
𝜕 𝑥 =𝑢𝑖 , 𝑗−𝑢𝑖 −1 , 𝑗
Δ𝑥
𝜕2𝑢𝑖 , 𝑗
𝜕 𝑥2=𝑢𝑖+1 , 𝑗−2𝑢𝑖 , 𝑗+𝑢𝑖− 1 , 𝑗
(Δ𝑥 )2
Von-Neumann Analysis• A Finite Difference Equation converges to its PDE when it
is stable• Lax-Equivalence Theorem
• Break the solution into its Fourier modes and examine one of them.• Let in the difference equation (Where is the imaginary unit)
• Solve for the amplification factor, • Stable when 𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
1D Heat-Diffusion EquationA PARABOLIC PDE – TEMPERATURE DISTRIBUTION IN A ROD
𝜕𝑢𝜕𝑡 =𝑘 𝜕
2𝑢𝜕 𝑦 2
Forward Time Difference!
𝑢𝑖𝑛+1=𝑢𝑖
𝑛+𝑘 Δ𝑡Δ𝑥2
[𝑢𝑖+1𝑛 −2𝑢𝑖 , 𝑗+1+𝑢𝑖−1
𝑛 ]
Backward Time
Difference! Centered Space Difference !
𝑢𝑖𝑛=−𝑘 Δ𝑡Δ𝑥2
𝑢𝑖+1
𝑛+1
+[1+𝑘 Δ𝑡Δ𝑥2 ]𝑢𝑖𝑛+1+
−𝑘 Δ𝑡Δ𝑥2
𝑢𝑖−1
𝑛+1
BTCS FTCS
Comparison of FTCS and BTCSBTCS
• Implicit• Slow• Unconditionally Stable
FTCS
• Explicit• Fast• Conditionally Stable
• Only when
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
Error Analysis• Both schemes have an error O() and
O()
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
Different Boundary Conditions - Example
DIRICHLET
• Heat escapes out of the sides• Temperature at boundaries
is fixed
NEUMANN
• Heat is trapped• Heat Flux at boundaries is
fixed
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
Laplace’s EquationAN ELLIPTIC PDE – STEADY STATE 2D HEAT
𝜕2𝑢𝜕𝑥2
+𝜕2𝑢𝜕 𝑦2
=0Centered
Differences!
𝑢𝑖 , 𝑗=𝑢𝑖+1 , 𝑗+𝑢𝑖−1 , 𝑗+𝑢𝑖 , 𝑗+ 1+𝑢𝑖 , 𝑗−1
4
Jacobi IterationIterations through Grid: 999
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2𝑢𝑖 , 𝑗𝑛+1=
𝑢𝑖+1 , 𝑗𝑛 +𝑢𝑖− 1 , 𝑗
𝑛 +𝑢𝑖 , 𝑗+1𝑛 +𝑢𝑖 , 𝑗− 1
𝑛
4
Gauss-SeidelIterations through Grid: 692
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2𝑢𝑖 , 𝑗𝑛+1=
𝑢𝑖+1 , 𝑗𝑛 +𝑢𝑖− 1 , 𝑗
𝑛+1 +𝑢𝑖 , 𝑗+1𝑛 +𝑢𝑖 , 𝑗− 1
𝑛+1
4
Successive Over Relaxation Iterations through Grid: 395
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2𝑢𝑖 , 𝑗𝑛+1= (1−𝜔 )𝑢𝑖 , 𝑗
𝑛 +𝜔𝑢𝑖+1 , 𝑗𝑛 +𝑢𝑖−1 , 𝑗
𝑛+1 +𝑢𝑖 , 𝑗+ 1𝑛 +𝑢𝑖 , 𝑗−1
𝑛+1
4
Iterations Needed to Increase Accuracy
0 1 2 3 4 5 6 7 8 9 100
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
SOR Linear (SOR) JacobiPolynomial (Jacobi) Gauss Polynomial (Gauss)
Number of Times Error Threshold is Halved from 0.10
Num
ber
of It
erat
ions
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
High Frequency Error Dampening
𝑒𝑖𝛼 𝑥
𝐹 ∘
𝛻2
Jacobi Iteration Gauss-Seidel
Recommended