Scheme for solving Laplace's (Poisson's) equation

The right hand side is constrained by the values at the boundary plus the known function \( \tilde{\rho} \). 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 with \( n+1 \) mesh points, our matrix \( \mathbf{A}\in {\mathbb{R}}^{(n+1)\times (n+1)} \) leads to \( (n-1)\times (n-1) \) unknown function values \( u_{ij} \). This means that, if we fix the endpoints for the two-dimensional case (with a square lattice) at \( i(j)=0 \) and \( i(j)=n+1 \), we have to solve the equations for \( 1 \ge i(j) le n \).

Since the matrix is rather sparse but is not on a tridiagonal form, elimination methods like the LU decomposition discussed, are not very practical. Rather, iterative schemes like Jacobi's method or the Gauss-Seidel are preferred. The above matrix is also always diagonally dominant, a necessary condition for these iterative solvers to converge.