Description
Lecture 11
PDE and Programming (2)
Jung-Il Choi
Contents
Week 11 Week 12
• Multi-dimension • Poisson equation
Heat equation Iterative solution methods
Explicit method Point Jacobi method
Implicit methods in higher dimensions Gauss-Seidel method
Approximate factorization Successive over relaxation method (SOR)
Stability analysis Non-linear PDEs
Alternating direction implicit methods (ADI)
• 2D heat equation
Consider the two-dimensional heat equation
Spatial-discretize with centered scheme and apply explicit Euler method.
• Stability properties
In the same way, we can get stability condition for the 3D case
• 2D Heat equation example
𝜕𝜕𝜕𝜕 𝜕𝜕2𝜕𝜕 𝜕𝜕2𝜕𝜕
𝜕𝜕𝜕 = 𝛼𝛼 𝜕𝜕𝑥𝑥2 + 𝜕𝜕𝑥𝑥2 , Ω = 0,1 × [0,1]
Initial condition 𝑇𝑇 0, 𝑥𝑥, 𝑦𝑦 = sin 𝜋𝜋x sin(𝜋𝜋y)
Boundary condition 𝑇𝑇𝜕𝜕Ω = 0
Implicit methods in higher dimensions
• Implicit method
Consider application of Crank-Nicolson scheme
Implicit methods in higher dimensions
• Approximate factorization
Consider application of the Crank-Nicolson method with the second-order spatial differencing to 2D heat equation
……(1)
𝐴𝐴𝑥𝑥 and 𝐴𝐴𝑦𝑦 are the difference operators representing the spatial derivatives For example,
Eq(1) can represent like
• Approximate factorization
Rearrange the previous equation into a partial factored form
still second order accuracy
• Compare matrix form
𝜙𝜙
recall 𝐴𝐴𝑥𝑥𝜙𝜙 = 𝑖𝑖+1,𝑗𝑗 − 2Δ𝑥𝑥𝜙𝜙𝑖𝑖2,𝑗𝑗 + 𝜙𝜙𝑖𝑖−1,𝑗𝑗 , 𝐴𝐴𝑦𝑦𝜙𝜙 = 𝜙𝜙 𝑖𝑖,𝑗𝑗+1 − 2Δ𝑥𝑥𝜙𝜙𝑖𝑖2,𝑗𝑗 + 𝜙𝜙𝑖𝑖,𝑗𝑗−1
𝛼𝛼Δt 𝛼𝛼Δt
1+2 2+22Δ𝑦𝑦2
2Δ𝑥𝑥 𝛼𝛼Δt
− 2
2Δ𝑥𝑥
𝛼𝛼Δt
− 2
2Δ𝑥𝑥 𝛼𝛼Δt 𝛼𝛼Δt 𝛼𝛼Δt
− 2
2Δ𝑥𝑥
⋱ ⋱ ⋱
𝛼𝛼Δt
− 2
2Δ𝑥𝑥 𝛼𝛼Δt 𝛼𝛼Δt
1+2 2+22Δ𝑦𝑦2
2Δ𝑥𝑥
𝐵𝐵 = 𝐴𝐴, 𝐶𝐶 =
11 / 20
• Compare matrix form
After apply approximate factorization
• Implementation
• Implementation
Boundary treatment
𝛼𝛼Δt
1+ 2
Δy
𝛼𝛼Δt
⋱ 𝛼𝛼Δt
− 2
2Δy
𝛼𝛼Δt
1+ 2
Δ𝑦𝑦
⋱
𝛼𝛼Δt
1+ 2
Δ𝑦𝑦 𝛼𝛼Δt
𝛼𝛼Δt
− 2
2Δ𝑦𝑦 𝜙𝜙𝑖𝑖,1
𝜙𝜙𝑖𝑖,2
⋮
𝜙𝜙𝑖𝑖,𝑛𝑛𝑦𝑦−1 = 𝑧𝑧𝑖𝑖,1
𝑧𝑧𝑖𝑖,2
⋮
𝑧𝑧𝑖𝑖,𝑛𝑛𝑦𝑦−1
When 𝑖𝑖 = 1 𝑜𝑜𝑟𝑟 𝑛𝑛𝑥𝑥, boundary values for 𝒛𝒛 are required in the form of 𝑧𝑧0,𝑗𝑗 𝑜𝑜𝑟𝑟 𝑧𝑧𝑛𝑛𝑥𝑥,𝑗𝑗.
Now, we have intermediate solution vector 𝒛𝒛
• Pseudo code
𝛼𝛼Δt
1+ 2
Δy
𝛼𝛼Δt
⋱ 𝛼𝛼Δt
− 2
2Δy
𝛼𝛼Δt
1+ 2
Δ𝑦𝑦
⋱
𝛼𝛼Δt
1+ 2
Δ𝑦𝑦 𝛼𝛼Δt
−
𝛼𝛼Δt
− 2
2Δ𝑦𝑦 𝜙𝜙𝑖𝑖,1
𝜙𝜙𝑖𝑖,2
⋮
𝜙𝜙𝑖𝑖,𝑛𝑛𝑦𝑦−1 = 𝑧𝑧𝑖𝑖,1
𝑧𝑧𝑖𝑖,2
⋮
𝑧𝑧𝑖𝑖,𝑛𝑛𝑦𝑦−1
• Pseudo code
𝛼𝛼Δt
1+ 2
Δ𝑥𝑥
𝛼𝛼Δt
⋱ 𝛼𝛼Δt
− 2
2Δ𝑥𝑥
𝛼𝛼Δt
1+ 2
Δ𝑥𝑥
⋱
𝛼𝛼Δt
1+ 2
Δ𝑥𝑥 𝛼𝛼Δt
−
𝛼𝛼Δt
− 2
2Δ𝑥𝑥 𝑧𝑧1,𝑗𝑗
𝑧𝑧2,𝑗𝑗
⋮
𝑧𝑧𝑛𝑛𝑥𝑥−1,𝑗𝑗 = 𝑟𝑟ℎ𝑠𝑠1,𝑗𝑗 + 2 𝑧𝑧0,𝑗𝑗 2Δ𝑥𝑥
𝑟𝑟ℎ𝑠𝑠2,𝑗𝑗
⋮
𝛼𝛼Δt
𝑟𝑟ℎ𝑠𝑠𝑛𝑛𝑥𝑥−1,𝑗𝑗 + 2 𝑧𝑧𝑛𝑛𝑥𝑥,𝑗𝑗 2Δ𝑥𝑥
𝛼𝛼Δt
Stability of factored scheme
• Stability analysis
Unconditionally stable !
Alternating Direction Implicit Methods (ADI)
• Alternating Direction Implicit Methods (ADI)
Use operator splitting.
ADI scheme is an equivalent formulation of the factored scheme.
Consider half-step
Alternating Direction Implicit Methods (ADI)
• Alternating Direction Implicit Methods (ADI)
……(1)
Q&A Thanks for listening
Reviews
There are no reviews yet.