15
Differences Among Difference Schemes NUMERICAL METHODS FOR PDES William L. Ruys

Differences Among Difference Schemes

Embed Size (px)

Citation preview

Page 1: Differences Among Difference Schemes

Differences Among Difference Schemes

NUMERICAL METHODS FOR PDES

Will iam L. Ruys

Page 2: Differences Among Difference Schemes

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

Page 3: Differences Among Difference Schemes

Second Order Linear PDEs

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2

+E

β€’ Evolution with DiffusionParabolic

β€’ Steady StateElliptic

β€’ Evolution with ConservationHyperbol

ic

Page 4: Differences Among Difference Schemes

Finite Difference ApproximationsFORWARD DIFFERENCEBACKWARD DIFFERENCE

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2

SECOND ORDER CENTERED DIFFERENCE

πœ•π‘’π‘– , 𝑗

πœ• π‘₯ =𝑒𝑖+1 , π‘—βˆ’π‘’π‘– , 𝑗

Ξ”π‘₯πœ•π‘’π‘– , 𝑗

πœ• π‘₯ =𝑒𝑖 , π‘—βˆ’π‘’π‘– βˆ’1 , 𝑗

Ξ”π‘₯

πœ•2𝑒𝑖 , 𝑗

πœ• π‘₯2=𝑒𝑖+1 , π‘—βˆ’2𝑒𝑖 , 𝑗+π‘’π‘–βˆ’ 1 , 𝑗

(Ξ”π‘₯ )2

Page 5: Differences Among Difference Schemes

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

Page 6: Differences Among Difference Schemes

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

Page 7: Differences Among Difference Schemes

Comparison of FTCS and BTCSBTCS

β€’ Implicitβ€’ Slowβ€’ Unconditionally Stable

FTCS

β€’ Explicitβ€’ Fastβ€’ Conditionally Stable

β€’ Only when

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2

Page 8: Differences Among Difference Schemes

Error Analysisβ€’ Both schemes have an error O() and

O()

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2

Page 9: Differences Among Difference Schemes

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

Page 10: Differences Among Difference Schemes

Laplace’s EquationAN ELLIPTIC PDE – STEADY STATE 2D HEAT

πœ•2π‘’πœ•π‘₯2

+πœ•2π‘’πœ• 𝑦2

=0Centered

Differences!

𝑒𝑖 , 𝑗=𝑒𝑖+1 , 𝑗+π‘’π‘–βˆ’1 , 𝑗+𝑒𝑖 , 𝑗+ 1+𝑒𝑖 , π‘—βˆ’1

4

Page 11: Differences Among Difference Schemes

Jacobi IterationIterations through Grid: 999

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2𝑒𝑖 , 𝑗𝑛+1=

𝑒𝑖+1 , 𝑗𝑛 +π‘’π‘–βˆ’ 1 , 𝑗

𝑛 +𝑒𝑖 , 𝑗+1𝑛 +𝑒𝑖 , π‘—βˆ’ 1

𝑛

4

Page 12: Differences Among Difference Schemes

Gauss-SeidelIterations through Grid: 692

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2𝑒𝑖 , 𝑗𝑛+1=

𝑒𝑖+1 , 𝑗𝑛 +π‘’π‘–βˆ’ 1 , 𝑗

𝑛+1 +𝑒𝑖 , 𝑗+1𝑛 +𝑒𝑖 , π‘—βˆ’ 1

𝑛+1

4

Page 13: Differences Among Difference Schemes

Successive Over Relaxation Iterations through Grid: 395

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2𝑒𝑖 , 𝑗𝑛+1= (1βˆ’πœ” )𝑒𝑖 , 𝑗

𝑛 +πœ”π‘’π‘–+1 , 𝑗𝑛 +π‘’π‘–βˆ’1 , 𝑗

𝑛+1 +𝑒𝑖 , 𝑗+ 1𝑛 +𝑒𝑖 , π‘—βˆ’1

𝑛+1

4

Page 14: Differences Among Difference Schemes

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

Page 15: Differences Among Difference Schemes

High Frequency Error Dampening

𝑒𝑖𝛼 π‘₯

𝐹 ∘

𝛻2

Jacobi Iteration Gauss-Seidel