Algorithm 986

Algorithm 986: A Suite of Compact Finite Difference Schemes. A collection of Matlab routines that compute derivative approximations of arbitrary functions using high-order compact finite difference schemes is presented. Tenth-order accurate compact finite difference schemes for first and second derivative approximations and sixth-order accurate compact finite difference schemes for third and fourth derivative approximations are discussed for the functions with periodic boundary conditions. Fourier analysis of compact finite difference schemes is explained, and it is observed that compact finite difference schemes have better resolution characteristics when compared to classical finite difference schemes. Compact finite difference schemes for the functions with Dirichlet and Neumann boundary conditions are also discussed. Moreover, compact finite difference schemes for partial derivative approximations of functions in two variables are also given. For each case a Matlab routine is provided to compute the differentiation matrix and results are validated using the test functions.