10.3 Laplace’s and Poisson’s Equations 317
In order to illustrate how we can transform the last equations into a linear algebra problem
of the typeAx=w, withAa matrix andxandwunknown and known vectors respectively, let
us also for the sake of simplicity assume that the number of pointsn= 3. We assume also that
u(x,y) =g(x,y)on the borderδ Ω. Our calculational molecule becomes then We can now spell
out the four equations which define the four unknown values ofthe function arising from the
four inner points, using the labeling of Fig. 10.5.
The inner values of the functionuare then given by
4 u 11 −u 21 −u 01 −u 12 −u 10 =−ρ ̃ 11
4 u 12 −u 02 −u 22 −u 13 −u 11 =−ρ ̃ 12
4 u 21 −u 11 −u 31 −u 22 −u 20 =−ρ ̃ 21
4 u 22 −u 12 −u 32 −u 23 −u 21 =−ρ ̃ 22.
If we isolate on the left-hand side the unknown quantitiesu 11 ,u 12 ,u 21 andu 22 , that is the inner
points not constrained by the boundary conditions, we can rewrite the above equations as a
matrixAtimes an unknown vectorx, that is
Ax=b,
or in more detail
4 − 1 −1 0
−1 4 0 − 1
−1 0 4 − 1
0 − 1 −1 4
u 11
u 12
u 21
u 22
=
u 01 +u 10 −ρ ̃ 11
u 13 +u 02 −ρ ̃ 12
u 31 +u 20 −ρ ̃ 21
u 32 +u 23 −ρ ̃ 22
.
The right hand side is constrained by the values at the boundary plus the known function
ρ ̃. For a two-dimensional equation it is easy to convince oneself that for larger sets of mesh
points, we will not have more than five function values for every row of the above matrix. For
a problem withn+ 1 mesh points, our matrixA∈R(n+^1 )×(n+^1 )leads to(n− 1 )×(n− 1 )unknown
g(x,y)
y
g(x,y)
g(x,y)
x
ui,j+ 1
ui− 1 ,j ui,j ui+ 1 ,j
ui,j− 1
✲
✻
Fig. 10.4Five-point calculational molecule for the Laplace operator of Eq. (10.13). The borderδ Ωdefines
the boundary conditionu(x,y) =g(x,y).