An algorithm for calculating Hermite-based finite difference weights
Bengt Fornberg
Abstract
Abstract Finite difference (FD) formulas approximate derivatives by weighted sums of function values. Given arbitrarily distributed node locations in one-dimension, a previous algorithm by the present author (1988, Generation of finite difference formulas on arbitrarily spaced grids. Math. Comput., 51, 699–706) provides FD weights of optimal order of accuracy for approximating any order derivative at a specified location. This algorithm is extended here to the case of finding weights to apply not only to function values but also to first derivative values in the case that these also are available. The MATLAB code for the algorithm is provided, and two examples are given to illustrate how this type of FD stencil can be applied to solving partial differential equations.