Skip to main content

Subsection 7.4.1 Details!

To solve the problem computationally the problem is again discretized. Relating back to the problem of the membrane on the unit square in the previous section, this means that the continuous domain is viewed as a mesh instead, as illustrated in Figure 7.4.1.1.

Figure 7.4.1.1. 2D mesh.

In that figure, \(\upsilon_i \) equals, for example, the displacement from rest of the point on the membrane.

Now, let \(\phi_i \) be the value of \(f( x, y ) \) at the mesh point \(i \text{.}\) One can approximate

\begin{equation*} \frac{\partial^2u( x, y )}{\partial x^2 } \approx \frac{u( x-h, y ) - 2 u( x,y ) + u( x+h, y )}{h^2} \end{equation*}

and

\begin{equation*} \frac{\partial^2u( x, y )}{\partial y^2 } \approx \frac{u( x, y-h ) - 2 u( x,y ) + u( x, y+h )}{h^2} \end{equation*}

so that

\begin{equation*} - \frac{\partial^2 u}{\partial x^2 } - \frac{\partial^2 u}{\partial y^2 } = f( x,y ) \end{equation*}

becomes

\begin{equation*} \frac{-u( x-h, y ) + 2 u( x,y ) - u( x+h, y )}{h^2} + \frac{-u( x, y-h ) + 2 u( x,y ) - u( x, y+h )}{h^2} = f( x, y ) \end{equation*}

or, equivalently,

\begin{equation*} \frac{- u( x-h, y ) - u( x, y-h ) + 4 u( x,y ) - u( x+h, y ) - u( x, y+h )}{h^2} = f( x, y ). \end{equation*}

If \(( x, y ) \) corresponds to the point \(i \) in a mesh where the interior points form an \(N \times N \) grid, this translates to the system of linear equations

\begin{equation*} - \upsilon_{i-N} - \upsilon_{i-1} + 4 \upsilon_i - \upsilon_{i+1} - \upsilon_{i+N} = h^2 \phi_i . \end{equation*}

This can be rewritten as

\begin{equation*} \upsilon_i = \frac{h^2 \phi_i + \upsilon_{i-N} + \upsilon_{i-1} + \upsilon_{i+1} + \upsilon_{i+N} }{4} \end{equation*}

or

\begin{equation*} \begin{array}{r r r r r r r r r r r c} 4 \upsilon_0 \amp - \upsilon_1 \amp \amp \amp - \upsilon_4 \amp \amp \amp \amp \amp \amp \amp = h^2 \phi_0 \\ - \upsilon_0 \amp + 4 \upsilon_1 \amp - \upsilon_2 \amp \amp \amp - \upsilon_5 \amp \amp \amp \amp \amp \amp = h^2 \phi_1 \\ \amp - \upsilon_1 \amp + 4 \upsilon_2 \amp - \upsilon_3 \amp \amp \amp - \upsilon_6 \amp \amp \amp \amp \amp = h^2 \phi_2 \\ \amp \amp - \upsilon_2 \amp + 4 \upsilon_3 \amp \amp \amp \amp - \upsilon_7 \amp \amp \amp \amp = h^2 \phi_3 \\ - \upsilon_0 \amp \amp \amp \amp + 4 \upsilon_4 \amp - \upsilon_5 \amp \amp \amp - \upsilon_8 \amp \amp \amp = h^2 \phi_4 \\ \amp \upsilon_1 \amp \amp \amp \ddots \amp \ddots \amp \ddots \amp \amp \amp\ddots \amp \amp \vdots \end{array} \end{equation*}

In matrix notation this becomes

\begin{equation} \left( \begin{array} {r r r r | r r r r | r r } 4 \amp -1 \amp \amp \amp -1 \amp \amp \amp \amp \amp \\ -1 \amp 4 \amp -1 \amp \amp \amp -1 \amp \amp \amp \amp \\ \amp -1 \amp 4 \amp -1 \amp \amp \amp -1 \amp \amp \amp \\ \amp \amp -1 \amp 4 \amp \amp \amp \amp -1 \amp \amp \\ \hline -1 \amp \amp \amp \amp 4 \amp -1 \amp \amp \amp -1 \amp \\ \amp -1 \amp \amp \amp -1 \amp 4 \amp -1 \amp \amp \amp \ddots \\ \amp \amp -1 \amp \amp \amp -1 \amp 4 \amp -1 \amp \amp \\ \amp \amp \amp -1 \amp \amp \amp -1 \amp 4 \amp \amp \\ \hline \amp \amp \amp \amp -1 \amp \amp \amp \amp 4 \amp \ddots \\ \amp \amp \amp \amp \amp \amp \ddots \amp \amp \ddots \amp \ddots \end{array} \right) \left( \begin{array}{c} \upsilon_0 \\ \upsilon_1\\ \upsilon_2\\ \upsilon_3\\ \hline \upsilon_4\\ \upsilon_5\\ \upsilon_6\\ \upsilon_7\\ \hline \upsilon_8 \\ \vdots \end{array} \right) = \left( \begin{array}{c} h^2 \phi_0 \\ h^2 \phi_1 \\ h^2 \phi_2 \\ h^2 \phi_3 \\ \hline h^2 \phi_4 \\ h^2 \phi_5 \\ h^2 \phi_6\\ h^2 \phi_7 \\ \hline h^2 \phi_8 \\ \vdots \end{array} \right). \label{chapter07-eqn-laplace}\tag{7.4.1} \end{equation}

This demonstrates how solving the discretized Poisson's equation boils down to the solution of a linear system \(A u = h^2 f \text{,}\) where \(A \) has a distinct sparsity pattern (pattern of nonzeros).