318 10 Partial Differential Equations
function valuesui j. This means that, if we fix the endpoints for the two-dimensional case (with
a square lattice) ati(j) = 0 andi(j) =n+ 1 , we have to solve the equations for 1 ≥i(j)len.
Since the matrix is rather sparse but is not on a tridiagonal form, elimination methods
like the LU decomposition discussed in chapter 6, are not very practical. Rather, iterative
schemes like Jacobi’s method or the Gauss-Seidel method discussed in the same chapter, are
preferred. The above matrix is also always diagonally dominant, a necessary condition for
these iterative solvers to converge.
In setting up for example Jacobi’s method, it is useful to rewrite the matrixAas
A=D+U+L,
withDbeing a diagonal matrix with 4 as the only value, U
̄
is an upper triangular matrix and
La lower triangular matrix. In our case we have
D=
4 0 0 0
0 4 0 0
0 0 4 0
0 0 0 4
,
and
L=
0 0 0 0
−1 0 0 0
−1 0 0 0
0 − 1 −1 0
U=
0 − 1 −1 0
0 0 0 − 1
0 0 0 − 1
0 0 0 0
.
We assume now that we have an estimate for the unknown functionsu 11 ,u 12 ,u 21 andu 22. We
will call this the zeroth value and label it asu( 110 ),u( 120 ),u( 210 )andu( 220 ). We can then set up an
iterative scheme where the next solution is defined in terms of the previous one as
u( 111 )=^14 (b 1 −u( 120 )−u( 210 ))
u( 121 )=^14 (b 2 −u( 110 )−u( 220 ))
u( 211 )=^14 (b 3 −u( 110 )−u( 220 ))
u( 221 )=^14 (b 4 −u( 120 )−u( 210 )),
y
x
u 00
u 01
u 02
u 03
u 10
u 11
u 12
u 13
u 20
u 21
u 22
uu 232 , 3
u 30
u 31
u 32
u 33
✲
✻
Fig. 10.5Explicit molecule forn= 3. The borderδ Ωdefines the boundary conditionu(x,y) =g(x,y).