Lably
Skip to content

Finite difference coefficient

Coefficient used in numerical approximation

  • 2 min read
  • 4 chapters

Related on Lably

Through Mathematics, Derivative and Convolution

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‴(x0)≈−12f(x−2)+f(x−1)−f(x+1)+12f(x+2)hx3+O(hx2),

where hx represents a uniform grid spacing between each finite difference interval, and xn=x0+nhx.

For the m-th derivative with accuracy n, there are 2p+1=2⌊m+12⌋−1+n central coefficients a−p,a−p+1,...,ap−1,ap. These are given by the solution of the linear equation system

(11...11−p−p+1...p−1p(−p)2(−p+1)2...(p−1)2p2.............................................(−p)2p(−p+1)2p...(p−1)2pp2p)(a−pa−p+1a−p+2.........ap)=(000...m!...0),

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 JT is a transposed Vandermonde matrix, 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 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 or via a matrix-vector-product. The coefficients given in the table above correspond to the latter definition.

The theory of Lagrange polynomials provides explicit formulas for the finite difference coefficients. For the first six derivatives we have the following:

where Hn,m are generalized harmonic numbers.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Topics in mathematics