Chapter 4 - Slope

4.4 Accuracy of Finite Difference Methods

The Skewed Mexican Hat function can be differentiated exactly by Maple. This provides a standard against which to judge the goodness of the different approximate formulae. The following Maple worksheet plots the slope of the Skewed Mexican hat function calculated by the three approximate forms together with the exact derivative for d = Dx = 0.5. It is clear that the Symmetric Difference formula is much closer to the exact derivative than the other two forms. The definition of the functions sl_forward(d,x), sl_backward(d,x), and sl_symmetric(d,x) are assumed to have been done as in section 4.2.

Note that d = Dx = 0.5 is a very large interval (compare it to the plot domain [-2,2]). The slope function calculated via the Symmetric Difference formula converges to the exact derivative for smaller d.

These calculations illustrate that the Symmetric Difference formula is very accurate in calculating the slope. This can be understood easily; the Symmetric Difference formula originates from a local parabolic approximation of the function near the point where the slope is needed. The Forward and Backward formula stem from local straight line approximations to the function; therefore, these formulae can not provide as accurate an approximation to the slope as that of the Symmetric Difference formula.


 
Section 4.3 Chapter 4 Section 4.5       TOC

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu