In mathematics, the discrete Poisson equation is the finite difference analog of the Poisson equation. In it, the discrete Laplace operator takes the place of the Laplace operator. The discrete Poisson equation is frequently used in numerical analysis as a stand-in for the continuous Poisson equation, although it is also studied in its own right as a topic in discrete mathematics.
Using the finite difference numerical method to discretize the 2-dimensional Poisson equation (assuming a uniform spatial discretization,                     Δ        x        =        Δ        y                ) on an m × n grid gives the following formula:
                    (                              ∇                                2                          u                  )                      i            j                          =                              1                          Δ                              x                                  2                                                                    (                  u                      i            +            1            ,            j                          +                  u                      i            −            1            ,            j                          +                  u                      i            ,            j            +            1                          +                  u                      i            ,            j            −            1                          −        4                  u                      i            j                          )        =                  g                      i            j                                  where                     2        ≤        i        ≤        m        −        1                 and                     2        ≤        j        ≤        n        −        1                . The preferred arrangement of the solution vector is to use natural ordering which, prior to removing boundary elements, would look like:
                                                        u              →                                      =                                            [                                                                                          u                                              11                                                              ,                                          u                                              21                                                              ,                    …                    ,                                          u                                              m                        1                                                              ,                                          u                                              12                                                              ,                                          u                                              22                                                              ,                    …                    ,                                          u                                              m                        2                                                              ,                    …                    ,                                          u                                              m                        n                                                                                                        ]                                            T                                  This will result in an mn × mn linear system:
                    A                                            u              →                                      =                                            b              →                                              where
                    A        =                              [                                                                               D                                                  −                  I                                                                     0                                                                     0                                                                     0                                                  …                                                                     0                                                                              −                  I                                                                     D                                                  −                  I                                                                     0                                                                     0                                                  …                                                                     0                                                                                                 0                                                  −                  I                                                                     D                                                  −                  I                                                                     0                                                  …                                                                     0                                                                              ⋮                                                  ⋮                                                  ⋮                                                  ⋮                                                  ⋮                                                  ⋱                                                  ⋮                                                                                                 0                                                  …                                                                     0                                                  −                  I                                                                     D                                                  −                  I                                                                     0                                                                                                 0                                                  …                                                  …                                                                     0                                                  −                  I                                                                     D                                                  −                  I                                                                                                 0                                                  …                                                  …                                                  …                                                                     0                                                  −                  I                                                                     D                                                      ]                          ,                                    I                 is the m × m identity matrix, and                     D                , also m × m, is given by:
                    D        =                              [                                                                               4                                                  −                  1                                                                     0                                                                     0                                                                     0                                                  …                                                                     0                                                                              −                  1                                                                     4                                                  −                  1                                                                     0                                                                     0                                                  …                                                                     0                                                                                                 0                                                  −                  1                                                                     4                                                  −                  1                                                                     0                                                  …                                                                     0                                                                              ⋮                                                  ⋮                                                  ⋮                                                  ⋮                                                  ⋮                                                  ⋱                                                  ⋮                                                                                                 0                                                  …                                                                     0                                                  −                  1                                                                     4                                                  −                  1                                                                     0                                                                                                 0                                                  …                                                  …                                                                     0                                                  −                  1                                                                     4                                                  −                  1                                                                                                 0                                                  …                                                  …                                                  …                                                                     0                                                  −                  1                                                                     4                                                      ]                          ,                 and                                                         b              →                                               is defined by
                                                        b              →                                      =        −        Δ                  x                      2                                                              [                                                                                          g                                              11                                                              ,                                          g                                              21                                                              ,                    …                    ,                                          g                                              m                        1                                                              ,                                          g                                              12                                                              ,                                          g                                              22                                                              ,                    …                    ,                                          g                                              m                        2                                                              ,                    …                    ,                                          g                                              m                        n                                                                                                        ]                                            T                          .                For each                               u                      i            j                                   equation, the columns of                     D                 correspond to a block of                     m                 components in                     u                :
                                                        [                                                                                          u                                              1                        j                                                              ,                                                                              u                                              2                        j                                                              ,                                                        …                    ,                                                                              u                                              i                        −                        1                        ,                        j                                                              ,                                                                              u                                              i                        j                                                              ,                                                                              u                                              i                        +                        1                        ,                        j                                                              ,                                                        …                    ,                                                                              u                                              m                        j                                                                                                        ]                                            T                                  while the columns of                     I                 to the left and right of                     D                 each correspond to other blocks of                     m                 components within                     u                :
                                                        [                                                                                          u                                              1                        ,                        j                        −                        1                                                              ,                                                                              u                                              2                        ,                        j                        −                        1                                                              ,                                                        …                    ,                                                                              u                                              i                        −                        1                        ,                        j                        −                        1                                                              ,                                                                              u                                              i                        ,                        j                        −                        1                                                              ,                                                                              u                                              i                        +                        1                        ,                        j                        −                        1                                                              ,                                                        …                    ,                                                                              u                                              m                        ,                        j                        −                        1                                                                                                        ]                                            T                                  and
                                                        [                                                                                          u                                              1                        ,                        j                        +                        1                                                              ,                                                                              u                                              2                        ,                        j                        +                        1                                                              ,                                                        …                    ,                                                                              u                                              i                        −                        1                        ,                        j                        +                        1                                                              ,                                                                              u                                              i                        ,                        j                        +                        1                                                              ,                                                                              u                                              i                        +                        1                        ,                        j                        +                        1                                                              ,                                                        …                    ,                                                                              u                                              m                        ,                        j                        +                        1                                                                                                        ]                                            T                                  respectively.
From the above, it can be inferred that there are                     n                 block columns of                     m                 in                     A                . It is important to note that prescribed values of                     u                 (usually lying on the boundary) would have their corresponding elements removed from                     I                 and                     D                . For the common case that all the nodes on the boundary are set, we have                     2        ≤        i        ≤        m        −        1                 and                     2        ≤        j        ≤        n        −        1                , and the system would have the dimensions (m − 2)(n − 2) × (m − 2)(n − 2), where                     D                 and                     I                 would have dimensions (m − 2) × (m − 2).
For a 5×5 (                     m        =        5                 and                     n        =        5                 ) grid with all the boundary nodes prescribed, the system would look like:
                                          [                                                            U                                                      ]                          =                                            [                                                                                          u                                              22                                                              ,                                          u                                              32                                                              ,                                          u                                              42                                                              ,                                          u                                              23                                                              ,                                          u                                              33                                                              ,                                          u                                              43                                                              ,                                          u                                              24                                                              ,                                          u                                              34                                                              ,                                          u                                              44                                                                                                        ]                                            T                                  with
                    A        =                              [                                                                               4                                                  −                  1                                                                     0                                                  −                  1                                                                     0                                                                     0                                                                     0                                                                     0                                                                     0                                                                              −                  1                                                                     4                                                  −                  1                                                                     0                                                  −                  1                                                                     0                                                                     0                                                                     0                                                                     0                                                                                                 0                                                  −                  1                                                                     4                                                                     0                                                                     0                                                  −                  1                                                                     0                                                                     0                                                                     0                                                                              −                  1                                                                     0                                                                     0                                                                     4                                                  −                  1                                                                     0                                                  −                  1                                                                     0                                                                     0                                                                                                 0                                                  −                  1                                                                     0                                                  −                  1                                                                     4                                                  −                  1                                                                     0                                                  −                  1                                                                     0                                                                                                 0                                                                     0                                                  −                  1                                                                     0                                                  −                  1                                                                     4                                                                     0                                                                     0                                                  −                  1                                                                                                 0                                                                     0                                                                     0                                                  −                  1                                                                     0                                                                     0                                                                     4                                                  −                  1                                                                     0                                                                                                 0                                                                     0                                                                     0                                                                     0                                                  −                  1                                                                     0                                                  −                  1                                                                     4                                                  −                  1                                                                                                 0                                                                     0                                                                     0                                                                     0                                                                     0                                                  −                  1                                                                     0                                                  −                  1                                                                     4                                                      ]                                  and
                                                        b              →                                      =                  [                                                                      −                  Δ                                      x                                          2                                                                            g                                          22                                                        +                                      u                                          12                                                        +                                      u                                          21                                                                                                                    −                  Δ                                      x                                          2                                                                            g                                          32                                                        +                                      u                                          31                                                                                                                                                                                                                                                                            −                  Δ                                      x                                          2                                                                            g                                          42                                                        +                                      u                                          52                                                        +                                      u                                          41                                                                                                                    −                  Δ                                      x                                          2                                                                            g                                          23                                                        +                                      u                                          13                                                                                                                                                                                                                                                                            −                  Δ                                      x                                          2                                                                            g                                          33                                                                                                                                                                                                                                                                                                                                                                                                                                    −                  Δ                                      x                                          2                                                                            g                                          43                                                        +                                      u                                          53                                                                                                                                                                                                                                                                            −                  Δ                                      x                                          2                                                                            g                                          24                                                        +                                      u                                          14                                                        +                                      u                                          25                                                                                                                    −                  Δ                                      x                                          2                                                                            g                                          34                                                        +                                      u                                          35                                                                                                                                                                                                                                                                            −                  Δ                                      x                                          2                                                                            g                                          44                                                        +                                      u                                          54                                                        +                                      u                                          45                                                                                                    ]                .                As can be seen, the boundary                     u                's are brought to the right-hand-side of the equation. The entire system is 9 × 9 while                     D                 and                     I                 are 3 × 3 and given by:
                    D        =                              [                                                                               4                                                  −                  1                                                                     0                                                                              −                  1                                                                     4                                                  −                  1                                                                                                 0                                                  −                  1                                                                     4                                                      ]                                  and
                    −        I        =                              [                                                            −                  1                                                                     0                                                                     0                                                                                                 0                                                  −                  1                                                                     0                                                                                                 0                                                                     0                                                  −                  1                                                      ]                          .                Because                                           [                                                            A                                                      ]                                   is block tridiagonal and sparse, many methods of solution have been developed to optimally solve this linear system for                                           [                                                            U                                                      ]                                  . Among the methods are a generalized Thomas algorithm with a resulting computational complexity of                     O        (                  n                      2.5                          )                , cyclic reduction, successive overrelaxation that has a complexity of                     O        (                  n                      1.5                          )                , and Fast Fourier transforms which is                     O        (        n        l        o        g        (        n        )        )                . An optimal                     O        (        n        )                 solution can also be computed using multigrid methods. 
In computational fluid dynamics, for the solution of an incompressible flow problem, the incompressibility condition acts as a constraint for the pressure. There is no explicit form available for pressure in this case due to a strong coupling of the velocity and pressure fields. In this condition, by taking the divergence of all terms in the momentum equation, one obtains the pressure poisson equation.
For an incompressible flow this constraint is given by:
                                                        ∂                              v                                  x                                                                    ∂              x                                      +                                            ∂                              v                                  y                                                                    ∂              y                                      +                                            ∂                              v                                  z                                                                    ∂              z                                      =        0                where                               v                      x                                   is the velocity in the                     x                 direction,                               v                      y                                   is velocity in                     y                 and                               v                      z                                   is the velocity in the                     z                 direction. Taking divergence of the momentum equation and using the incompressibility constraint, the pressure poisson equation is formed given by:
                              ∇                      2                          p        =        f        (        ν        ,        V        )                where                     ν                 is the kinematic viscosity of the fluid and                     V                 is the velocity vector.
The discrete Poisson's equation arises in the theory of Markov chains. It appears as the relative value function for the dynamic programming equation in a Markov decision process, and as the control variate for application in simulation variance reduction.