Finite Difference Coefficient
   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 ...
, to approximate a
derivative In mathematics, the derivative is a fundamental tool that quantifies the sensitivity to change of a function's output with respect to its input. The derivative of a function of a single variable at a chosen input value, when it exists, is t ...
to an arbitrary order of accuracy, it is possible to use the
finite difference A finite difference is a mathematical expression of the form . Finite differences (or the associated difference quotients) are often used as approximations of derivatives, such as in numerical differentiation. The difference operator, commonly d ...
. A finite difference can be central, forward or backward.


Central finite difference

This table contains the coefficients of the central differences, for several orders of accuracy and with uniform grid spacing:. For example, the third derivative with a second-order accuracy is : f(x_) \approx \frac + O\left(h_x^2 \right), where h_x represents a uniform grid spacing between each finite difference interval, and x_n = x_0 + n h_x. For the m-th derivative with accuracy n, there are 2p + 1 = 2 \left\lfloor \frac \right\rfloor - 1 + n central coefficients a_, a_, ..., a_, a_p. These are given by the solution of the linear equation system : \begin 1 & 1 & ... & 1 & 1 \\ -p & -p+1 & ... & p-1 & p \\ (-p)^2 & (-p+1)^2 &... & (p-1)^2 & p^2 \\ ... & ... &...&...&... \\ ... & ... &...&...&... \\ ... & ... &...&...&... \\ (-p)^ & (-p+1)^ & ... & (p-1)^ & p^ \end \begin a_ \\ a_ \\ a_ \\ ... \\ ... \\ ... \\ a_p \end = \begin 0 \\ 0 \\ 0 \\ ... \\ m! \\ ...\\ 0 \end, where the only non-zero value on the right hand side is in the (m+1)-th row. An open source implementation for calculating finite difference coefficients of arbitrary derivates and accuracy order in one dimension is available.
Given that the left-hand side matrix \mathbf^ is a transposed
Vandermonde matrix In linear algebra, a Vandermonde matrix, named after Alexandre-Théophile Vandermonde, is a matrix with the terms of a geometric progression in each row: an (m + 1) \times (n + 1) matrix :V = V(x_0, x_1, \cdots, x_m) = \begin 1 & x_0 & x_0^2 & \dot ...
, a rearrangement reveals that the coefficients are basically computed by fitting and deriving a 2p-th order polynomial to a window of 2p + 1 points. Consequently, the coefficients can also be computed as the m-th order derivative of a fully determined
Savitzky–Golay filter A Savitzky–Golay filter is a digital filter that can be applied to a set of digital data points for the purpose of smoothing the data, that is, to increase the precision of the data without distorting the signal tendency. This is achieved, in a ...
with polynomial degree 2p and a window size of 2p + 1. For this, open source implementations are also available. There are two possible definitions which differ in the ordering of the coefficients: a filter for filtering via
discrete convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
or via a matrix-vector-product. The coefficients given in the table above correspond to the latter definition. The theory of
Lagrange polynomials In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of lowest degree of a polynomial, degree that polynomial interpolation, interpolates a given set of data. Given a data set of graph of a function, coordinate ...
provides explicit formulas for the finite difference coefficients. For the first six derivatives we have the following: where H_ are generalized harmonic numbers.


Forward finite difference

This table contains the coefficients of the forward differences, for several orders of accuracy and with uniform grid spacing: For example, the first derivative with a third-order accuracy and the second derivative with a second-order accuracy are : \displaystyle f'(x_) \approx \displaystyle \frac + O\left(h_^3 \right), : \displaystyle f''(x_) \approx \displaystyle \frac + O\left(h_^2 \right), while the corresponding backward approximations are given by : \displaystyle f'(x_) \approx \displaystyle \frac + O\left(h_^3 \right), : \displaystyle f''(x_) \approx \displaystyle \frac + O\left(h_^2 \right),


Backward finite difference

To get the coefficients of the backward approximations from those of the forward ones, give all ''odd'' derivatives listed in the table in the previous section the opposite sign, whereas for ''even'' derivatives the signs stay the same. The following table illustrates this:


Arbitrary stencil points

For \displaystyle N arbitrary stencil points \displaystyle s and any derivative of order \displaystyle d < N up to one less than the number of stencil points, the finite difference coefficients can be obtained by solving the linear equations : \begin s_1^0 & \cdots & s_N^0 \\ \vdots & \ddots & \vdots \\ s_1^ & \cdots & s_N^ \end \begin a_1 \\ \vdots \\ a_N \end = d! \begin \delta_ \\ \vdots\\ \delta_\\ \vdots\\ \delta_ \end, where \delta_ is the
Kronecker delta In mathematics, the Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually just non-negative integers. The function is 1 if the variables are equal, and 0 otherwise: \delta_ = \begin 0 &\text i \neq j, \\ 1 &\ ...
, equal to one if i = j, and zero otherwise. Example, for s = 3, -2, -1, 0, 1/math>, order of differentiation d = 4: : \begin a_ \\ a_ \\ a_ \\ a_4 \\ a_5 \end = \begin 1 & 1 & 1 & 1 & 1 \\ -3 & -2 & -1 & 0 & 1 \\ 9 & 4 & 1 & 0 & 1 \\ -27 & -8 & -1 & 0 & 1 \\ 81 & 16 & 1 & 0 & 1 \\ \end^ \begin 0 \\ 0 \\ 0 \\ 0 \\ 24 \end = \begin 1 \\ -4 \\ 6 \\ -4\\ 1 \end. The order of accuracy of the approximation takes the usual form O\left(h_^\right) (or better in the case of central finite difference).


See also

*
Finite difference method In numerical analysis, finite-difference methods (FDM) are a class of numerical techniques for solving differential equations by approximating Derivative, derivatives with Finite difference approximation, finite differences. Both the spatial doma ...
*
Finite difference A finite difference is a mathematical expression of the form . Finite differences (or the associated difference quotients) are often used as approximations of derivatives, such as in numerical differentiation. The difference operator, commonly d ...
*
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 ...
*
Numerical differentiation In numerical analysis, numerical differentiation algorithms estimate the derivative of a mathematical function or subroutine using values of the function and perhaps other knowledge about the function. Finite differences The simplest method is ...


References

{{DEFAULTSORT:Finite Difference Coefficient Finite differences Numerical differential equations