Stencils are the basis for many algorithms to numerically solve partial differential equations (PDE).
Stencils are classified into two categories: compact and non-compact, the difference being the layers from the point of interest that are also used for calculation.
Graphical representations of node arrangements and their coefficients arose early in the study of PDEs.
The coefficients may be calculated by taking the derivative of the Lagrange polynomial interpolating between the node points,[3] by computing the Taylor expansion around each node point and solving a linear system,[4] or by enforcing that the stencil is exact for monomials up to the degree of the stencil.
is the ratio of the distance between the leftmost derivative and the left function entries divided by the grid spacing.