1. Poisson's Equation in 2D: T = κ∆T + q ρc - T = 0
1. Poisson's Equation in 2D: T = κ∆T + q ρc - T = 0
1. Poisson's Equation in 2D: T = κ∆T + q ρc - T = 0
Poisson’s Equation in 2D
We will now examine the general heat conduction equation,
q
Tt = κ∆T + .
ρc
in the 2-dimensional case, assuming a steady state problem (Tt = 0).
We get Poisson’s equation:
Poisson’s Equation in 2D
−uxx (x, y) − uyy (x, y) = f (x, y), (x, y) ∈ Ω = (0, 1) × (0, 1),
Analytic Solutions
A Linear System of . . .
Again, we will only deal with Dirichlet boundary conditions: Direct Solution of the LSE
Classification of PDE
u(x, y) = g(x, y) for x ∈ ∂Ω
Page 1 of 16
u(0, y) = u(1, y) = 0 0 ≤ y ≤ 1,
u(x, 0) = 0 0 ≤ x ≤ 1, Poisson’s Equation in 2D
A Finite Difference . . .
A Linear System of . . .
2.1. Separation of Variables – revisited
Direct Solution of the LSE
Similar to the 1D heat equation, we use the ansatz Classification of PDE
to get
Xxx (x) Yyy (y)
− =
X(x) Y (y)
Consequently, left hand side and right hand side have to be equal to Page 2 of 16
a constant λ. Introduction to Scientific Computing
Poisson’s Equation in 2D
Michael Bader
2.2. Particular solutions
For the function X(x), we get the eigenvalue problem
−Xxx (x) = λX(x), 0 < x < 1,
X(0) = X(1) = 0.
We already know that the eigenvalues are
λk = (kπ)2 ,
Poisson’s Equation in 2D
and the respective eigenfunctions are Analytic Solutions
A Linear System of . . .
The function Y (0) has to satisfy similar equations,
Direct Solution of the LSE
Yk (0) = 0,
however, note the absence of the minus sign!
√ √
Thus, Yk (y) is a linear combination of e λk y
and e− λk y
.
With Yk (0) = 0, we get the solution
Page 3 of 16
Yk (y) = sinh(kπy),
Introduction to Scientific Computing
A Finite Difference . . .
A Linear System of . . .
Thus, if we can represent the boundary function g(x) by
Direct Solution of the LSE
∞
Classification of PDE
X
g(x) = gk sin(kπx),
k=1
Poisson’s Equation in 2D
Analytic Solutions
x i,j+1
A Finite Difference . . .
x i−1,j x i,j x i+1,j A Linear System of . . .
hy
hx
• We have chosen h = hx = hy
Page 5 of 16
• function u will be computed at grid points xi,j ,
Introduction to Scientific Computing
i.e. we have unknowns ui,j ≈ u(xi,j ). Poisson’s Equation in 2D
Michael Bader
3.2. Discretization of the derivatives – Difference Quotients
Replace derivatives by difference quotients:
• first derivatives: forward, backward, or central differences
u(xk+1 ) − u(xk )
hx
∂u u(xk ) − u(xk−1 )
(xk ) ≈
∂x hx
Poisson’s Equation in 2D
u(x k+1 ) − u(xk−1 )
Analytic Solutions
2hx
A Finite Difference . . .
Classification of PDE
∂2u u(xk+1 ) − 2u(xk ) + u(xk−1 )
2
(xk ) ≈
∂x h2x
In stencil notation:
• [0 −1 1], [−1 1 0], or [−1 0 1] for the first derivatives
• [1 −2 1] for the second derivatives Page 6 of 16
Classification of PDE
This is often represented using a 2D stencil:
−1
−1
4
−1 4 −1 −1 −1
−1
Page 7 of 16
A Linear System of . . .
(ui+1,j + ui,j+1 − 4ui,j + ui,j−1 + ui−1,j )
− = f (xi,j ) for i, j = 1, . . . , n − 1 Direct Solution of the LSE
h2
Classification of PDE
• fh , similar to uh , is the vector of the right hand sides fi,j = Analytic Solutions
A Linear System of . . .
• Ah is the following sparse matrix
Direct Solution of the LSE
4 −1 −1
Classification of PDE
. . ..
−1 . . . . .
... ... ... ...
1
... ... ..
.
h2 −1 −1
.. .. .. ..
. . . .
. .. .. ..
. . −1 Page 9 of 16
−1 −1 4 Introduction to Scientific Computing
Poisson’s Equation in 2D
Michael Bader
Block-Tridiagonal Matrix:
A Linear System of . . .
While I is the unity matrix, Bh is given by Direct Solution of the LSE
Classification of PDE
4 −1 0 ···
0
..
...
−1 4 −1 .
Bh = ... ... ...
0 0
. ..
..
. −1 4 −1
0 · · · 0 −1 4
Page 10 of 16
Page 11 of 16
A Linear System of . . .
Solving our LSE using Gaussian elimination therefore requires Direct Solution of the LSE
Classification of PDE
O(N 2 ) = O(n4 ) operations.
⇒ Faster methods to solve the LSE are needed! Introduction to Scientific Computing
Poisson’s Equation in 2D
Michael Bader
5.2. Faster methods
Direct methods:
• use a clever numbering of the unknowns (not line by line but
“divide and conquer”)
⇒ nested dissection, O(n3 )
• use eigenvectors of the matrix, and Fast Sine Transform
⇒ Fast Poisson Solvers, O(n2 log n) Poisson’s Equation in 2D
Analytic Solutions
Iterative methods:
A Finite Difference . . .
• solve system line by line, but do this again and again A Linear System of . . .
⇒ Jacobi or Gauss-Seidel relaxation, O(n4 ) Direct Solution of the LSE
Classification of PDE
• clever weghting of corrections
⇒ SOR (successive over-relaxation), O(n3 )
• reformulate LSE as minimization problem
⇒ Krylow methods, Conjugate Gradients, O(n3 )
• use different mesh sizes and combine their solutions
⇒ Multigrid methods, O(n2 ) Page 13 of 16
ai,j (~x) · uxi ,xj (~x) + ai (~x) · uxi (~x) + a(~x) · u(~x) = f (~x) Analytic Solutions
i=1 j=1 i=1 A Finite Difference . . .
A Linear System of . . .
Some linear PDE of second order:
Direct Solution of the LSE
Page 14 of 16
Examples:
• Laplace equation, Poisson equation (elliptic):
A Finite Difference . . .
• heat equation (parabolic): A Linear System of . . .
utt = ∆u
Analytic Solutions
• parabolic PDE: A Finite Difference . . .
one eigenvalue of A is zero, the others have the same sign, and
A Linear System of . . .
the rank of A together with the vector of the ai is full (d)
Direct Solution of the LSE
• hyperbolic PDE: Classification of PDE
A has 1 pos. and d − 1 neg. eigenvalues or vice versa.
If the ai,j are functions of ~x:
• elliptic in ~x:
the matrix A of the ai,j (~x) is positive or negative definite for a
certain ~x
Page 16 of 16
• elliptic:
the matrix A of the ai,j (~x) is positive or negative definite for all ~x Introduction to Scientific Computing
Poisson’s Equation in 2D
Michael Bader