Stencil (numerical Analysis)
   HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, especially the areas of
numerical analysis Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of ...
concentrating on the numerical solution of partial differential equations, a stencil is a geometric arrangement of a nodal group that relate to the point of interest by using a numerical approximation routine. Stencils are the basis for many algorithms to numerically solve
partial differential equation In mathematics, a partial differential equation (PDE) is an equation which involves a multivariable function and one or more of its partial derivatives. The function is often thought of as an "unknown" that solves the equation, similar to ho ...
s (PDE). Two examples of stencils are the
five-point stencil In numerical analysis, given a square grid in one or two dimensions, the five-point stencil of a point in the grid is a stencil made up of the point itself together with its four "neighbors". It is used to write finite difference approximations t ...
and the
Crank–Nicolson method In numerical analysis, the Crank–Nicolson method is a finite difference method used for numerically solving the heat equation and similar partial differential equations. It is a Big O notation, second-order method in time. It is Explicit and im ...
stencil. Stencils are classified into two categories:
compact Compact as used in politics may refer broadly to a pact or treaty; in more specific cases it may refer to: * Interstate compact, a type of agreement used by U.S. states * Blood compact, an ancient ritual of the Philippines * Compact government, a t ...
and non-compact, the difference being the layers from the point of interest that are also used for calculation. In the notation used for one-dimensional stencils n-1, n, n+1 indicate the time steps where timestep n and n-1 have known solutions and time step n+1 is to be calculated. The spatial location of finite volumes used in the calculation are indicated by j-1, j and j+1.


Etymology

Graphical representations of node arrangements and their coefficients arose early in the study of PDEs. Authors continue to use varying terms for these such as "relaxation patterns", "operating instructions", "lozenges", or "point patterns". The term "stencil" was coined for such patterns to reflect the concept of laying out a
stencil Stencilling produces an image or pattern on a surface by applying pigment to a surface through an intermediate object, with designed holes in the intermediate object. The holes allow the pigment to reach only some parts of the surface creatin ...
in the usual sense over a computational grid to reveal just the numbers needed at a particular step.


Calculation of coefficients

The finite difference coefficients for a given stencil are fixed by the choice of node points. The coefficients may be calculated by taking the derivative of the
Lagrange polynomial In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of lowest degree that interpolates a given set of data. Given a data set of coordinate pairs (x_j, y_j) with 0 \leq j \leq k, the x_j are called ''nodes'' ...
interpolating between the node points, by computing the
Taylor expansion In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor ser ...
around each node point and solving a linear system, or by enforcing that the stencil is exact for
monomial In mathematics, a monomial is, roughly speaking, a polynomial which has only one term. Two definitions of a monomial may be encountered: # A monomial, also called a power product or primitive monomial, is a product of powers of variables with n ...
s up to the degree of the stencil. For equi-spaced nodes, they may be calculated efficiently as the
Padé approximant In mathematics, a Padé approximant is the "best" approximation of a function near a specific point by a rational function of given order. Under this technique, the approximant's power series agrees with the power series of the function it is ap ...
of x^s \cdot (\log x)^m, where m is the order of the stencil and s is the ratio of the distance between the leftmost derivative and the left function entries divided by the grid spacing.{{cite journal, last1=Fornberg, first1=Bengt, title=Classroom Note: Calculation of Weights in Finite Difference Formulas, journal=SIAM Review, date=January 1998, volume=40, issue=3, pages=685–691, doi=10.1137/S0036144596322507, bibcode=1998SIAMR..40..685F


See also

* Compact stencil * Non-compact stencil *
Five-point stencil In numerical analysis, given a square grid in one or two dimensions, the five-point stencil of a point in the grid is a stencil made up of the point itself together with its four "neighbors". It is used to write finite difference approximations t ...
* Nine-point stencil * Iterative Stencil Loops


References

* W. F. Spotz
High-Order Compact Finite Difference Schemes for Computational Mechanics
PhD thesis, University of Texas at Austin, Austin, TX, 1995. * Communications in Numerical Methods in Engineering, Copyright © 2008 John Wiley & Sons, Ltd. Numerical differential equations