Computes finite difference matrices for the first and second derivative up to sixth order, including compact finite-difference schemes such as the fourth-order Padé scheme and sixth-order Lele scheme (S. K. Lele. Compact finite difference schemes with spectral-like resolution. Journal of Computational Physics, 103(1):16–42, November 1992).
- 2nd order
- 4th order
- 6th order
- Padé (4th order compact scheme)
- Lele (6th order compact scheme)
This example is to demonstrate the perfomance of the different methods available. The function used in this example is given by:
which has the following derivatives:
Relative error (in log scale) obtained for the first derivative:
Relative error (in log scale) obtained for the second derivative:
The function shown in the example files is given by:
The partial derivatives are given by:
The images below show the absolute error in log scale for both the partial derivatives in x and y direction.