Discrete Poisson equation: Difference between revisions

→‎On a two-dimensional rectangular grid: The definition of the laplacian had the wrong sign. Changed sign in all equations
(d and partials -> Delta)
(→‎On a two-dimensional rectangular grid: The definition of the laplacian had the wrong sign. Changed sign in all equations)
 
:<math>
( {\nabla}^2 u )_{ij} = \frac{1}{\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>
 
A =
\begin{bmatrix}
~D & -I & ~0 & ~0 & ~0 & \ldots & ~0 \\
-I & ~D & -I & ~0 & ~0 & \ldots & ~0 \\
~0 & -I & ~D & -I & ~0 & \ldots & ~0 \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
~0 & \ldots & ~0 & -I & ~D & -I & ~0 \\
~0 & \ldots & \ldots & ~0 & -I & ~D & -I \\
~0 & \ldots & \ldots & \ldots & ~0 & -I & ~D
\end{bmatrix},
</math>
D =
\begin{bmatrix}
~-4 & -~1 & ~0 & ~0 & ~0 & \ldots & ~0 \\
-~1 & ~-4 & -~1 & ~0 & ~0 & \ldots & ~0 \\
~0 & -~1 & ~-4 & -~1 & ~0 & \ldots & ~0 \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
~0 & \ldots & ~0 & -~1 & ~-4 & -~1 & ~0 \\
~0 & \ldots & \ldots & ~0 & -~1 & ~-4 & -~1 \\
~0 & \ldots & \ldots & \ldots & ~0 & -~1 & ~-4
\end{bmatrix},
</math>