Compact stencil
In mathematics, especially in the areas of numerical analysis called numerical partial differential equations, a compact stencil is a type of stencil that uses only nine nodes for its discretization method in two dimensions.[src] It uses only the center node and the adjacent nodes.[src] For any structured grid utilizing a compact stencil in 1, 2, or 3 dimensions the maximum number of nodes is 3, 9, or 27 respectively.[src] Compact stencils may be compared to non-compact stencils.[src] Compact stencils are implemented in many partial differential equation solvers, including several in the topics of CFD, FEA, and other mathematical solvers relating to PDEs[src]
In mathematics, especially in the areas of numerical analysis called numerical partial differential equations, a compact stencil is a type of stencil that uses only nine nodes for its discretization method in two dimensions.[src] It uses only the center node and the adjacent nodes.[src] For any structured grid utilizing a compact stencil in 1, 2, or 3 dimensions the maximum number of nodes is 3, 9, or 27 respectively.[src] Compact stencils may be compared to non-compact stencils.[src] Compact stencils are implemented in many partial differential equation solvers, including several in the topics of CFD, FEA, and other mathematical solvers relating to PDEs ==Two point stencil example== The two point stencil for the first derivative of a function is given by: f'(x_0) = \frac{f{\left(x_0{+}h\right)} - f{\left(x_0{-}h\right)}}{2h} + \mathcal{O}{\left(h^2\right)}.[src] This is obtained from the Taylor series expansion of the first derivative of the function given by: f'(x_0)=\frac{f{\left(x_0{+}h\right)} - f(x_0)}{h} - \frac{f(x_0)}{2!}h - \frac{f^{(3)}(x_0)}{3!}h^2 - \frac{f^{(4)}(x_0)}{4!}h^3 + \cdots.[src] Replacing h with -h , we have: f'(x_0) = -\frac{f{\left(x_0{-}h\right) }- f(x_0)}{h} + \frac{f(x_0)}{2!}h - \frac{f^{(3)}(x_0)}{3!}h^2 + \frac{f^{(4)}(x_0)}{4!}h^3 + \cdots .[src] Addition of the above two equations together results in the cancellation of the terms in odd powers of h : \begin{align} 2f'(x_0) &= \frac{f{\left(x_0{+}h\right)} - f(x_0)}{h} - \frac{f{\left(x_0{-}h\right)} - f(x_0)}{h} -2\frac{f^{(3)}(x_0)}{3!}h^2 + \cdots \\[1ex] f'(x_0) &= \frac{f{\left(x_0{+}h\right)} - f{\left(x_0{-}h\right)}}{2h} - \frac{f^{(3)}(x_0)}{3!}h^2 + \cdots \\ &=\frac{f{\left(x_0{+}h\right)} - f{\left(x_0{-}h\right)}}{2h} + \mathcal{O}{\left(h^2\right)}.[src] \end{align} ==Three point stencil example== For example, the three point stencil for the second derivative of a function is given by: f(x_0) = \frac{f{\left(x_0{+}h\right)} + f{\left(x_0{-}h\right)} - 2f(x_0)}{h^2} + \mathcal{O}{\left(h^2\right)}.[src] This is obtained from the Taylor series expansion of the first derivative of the function given by: f'(x_0) = \frac{f{\left(x_0{+}h\right)} - f(x_0)}{h} -\frac{f(x_0)}{2!}h - \frac{f^{(3)}(x_0)}{3!}h^2 - \frac{f^{(4)}(x_0)}{4!}h^3 + \cdots.[src] Replacing h with -h , we have: f'(x_0) = -\frac{f{\left(x_0{-}h\right)} - f(x_0)}{h} + \frac{f(x_0)}{2!}h - \frac{f^{(3)}(x_0)}{3!}h^2 + \frac{f^{(4)}(x_0)}{4!}h^3 + \cdots .[src] Subtraction of the above two equations results in the cancellation of the terms in even powers of h : \begin{align} 0 &= \frac{f{\left(x_0{+}h\right)} - f(x_0)}{h} + \frac{f{\left(x_0{-}h\right)} - f(x_0)}{h} - 2\frac{f^{(2)}(x_0)}{2!}h - 2\frac{f^{(4)}(x_0)}{4!}h^3 + \cdots.[src] \\[1ex] f^{(2)}(x_0) &= \frac{f{\left(x_0{+}h\right)} + f{\left(x_0{-}h\right)} - 2f(x_0)}{h^2} - 2\frac{f^{(4)}(x_0)}{4!}h^2 + \cdots.[src] \\[1ex] f^{(2)}(x_0) &= \frac{f{\left(x_0{+}h\right)} + f{\left(x_0{-}h\right)} - 2f(x_0)}{h^2} + \mathcal{O}{\left(h^2\right)}.[src] \end{align} ==See also== Five-point stencil Nine-point stencil[src]
20 sentences · 20 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Compact stencil." encyclopegia.org, 2026, https://encyclopegia.org/wiki/compact-stencil. Accessed 28 November 2026.
Chicago
"Compact stencil." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/compact-stencil.
APA
encyclopegia.org. (2026). Compact stencil. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/compact-stencil
Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON