Discrete Poisson equation: Difference between revisions

 
:<math>
( {\nabla}^2 u )_{ij} = \frac{1}{dx\Delta x^2} ( -u_{i+1,j} - u_{i-1,j} - u_{i,j+1} - u_{i,j-1} + 4 u_{ij}) = g_{ij}
</math>
 
 
:<math>
U =
\begin{bmatrix} U \end{bmatrix} =
\begin{bmatrix} u_{11} , u_{21} , \ldots , u_{m1} , u_{12} , u_{22} , \ldots , u_{m2} , \ldots , u_{mn}
\end{bmatrix}^T
This will result in an ''mn''&nbsp;&times;&nbsp;''mn'' linear system:
 
:<math> AU = b </math>
\begin{bmatrix} A \end{bmatrix} \begin{bmatrix} U \end{bmatrix} = \begin{bmatrix} b \end{bmatrix}
</math>
 
where
~0 & \ldots & \ldots & ~0 & -I & ~D & -I \\
~0 & \ldots & \ldots & \ldots & ~0 & -I & ~D
\end{bmatrix},
</math>
 
~0 & \ldots & \ldots & ~0 & -1 & ~4 & -1 \\
~0 & \ldots & \ldots & \ldots & ~0 & -1 & ~4
\end{bmatrix},
</math>
 
<ref>Golub, Gene H. and C.F. Van Loan, ''Matrix Computations, 3rd Ed.'',
The Johns Hopkins University Press, Baltimore, 1996, pages 177–180.</ref>
and <math>b</math> is defined by
 
:<math>
b =
\Delta x^2\begin{bmatrix} g_{11} , g_{21} , \ldots , g_{m1} , g_{12} , g_{22} , \ldots , g_{m2} , \ldots , g_{mn}
\end{bmatrix}^T.
</math>
 
For each <math> u_{ij} </math> equation, the columns of <math> D </math> correspond to the <math> u </math> components: