Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Accurate numerical derivatives in MATLAB
Shampine L. ACM Transactions on Mathematical Software33 (4):26-es,2007.Type:Article
Date Reviewed: Feb 25 2008

The use of finite difference methods for approximating derivatives has historic roots (recall the definition of the derivative from calculus). The need for derivatives is fundamental in calculations solving nonlinear problems, as the use of Newton-like approaches is central to the solution of such problems. Specific examples occur in initial and boundary value ordinary differential equations (ODEs) and nonlinear optimization. While the finite difference approach to approximating derivatives is commonly used, there are more accurate and efficient alternatives embodied in the use of automatic differentiation. This paper provides an alternative that can be used for approximating the first derivative with an accuracy and speed comparable to the automated differentiation approach. Additionally, this is accomplished via the use of a package called PMAD, developed for the MATLAB problem solving environment (PSE).

The approach is based on the use of complex step differentiation (CSD), which allows for the use of very small step sizes; thus, very accurate first derivative approaches are obtained. While the use of centered finite difference approximation yields the same accuracy as CSD differencing [1], for the centered difference approach, using a small step size h, relative to the independent variable x, may lead to loss of accuracy. In a complex case, this does not occur since the step size is done in an imaginary direction, and even for a small h, the effect of the step is not lost. This is the key observation that enables highly accurate approximation of the first derivative of the function to be obtained.

The paper provides a thorough development of the history, approach, and software in the package. Historical ties to automatic differentiation and the relative strengths and limitations of this approach and PMAD are detailed. The package allows for two options: the fast option and an object-oriented (OO) approach. The fast approach is not as fast as the OO approach, and is in fact comparable in speed to the finite difference approach. However, the OO approach has an interface that is easier to use. The paper provides considerable detail on these approaches. It includes examples from the areas obtaining the Jacobian for boundary value ODEs and for solving a system of nonlinear equations. The software is available from Shampine’s Web site.

The only error in the paper is a slight mistyping of the URL (which should be: faculty.smu.edu/shampine/current.html).

Reviewer:  Mike Minkoff Review #: CR135295 (0812-1204)
1) Squire, W.; Trapp, G. Using complex variables to estimate derivatives of real functions. SIAM Review 40, 1(1998), 110–112.
Bookmark and Share
  Reviewer Selected
 
 
Automatic Differentiation (G.1.4 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Automatic Differentiation": Date
Using AD to solve BVPs in MATLAB
Shampine L., Ketzscher R., Forth S. ACM Transactions on Mathematical Software 31(1): 79-94, 2005. Type: Article
Apr 20 2005
Algorithm 799: revolve: an implementation of checkpointing for the reverse or adjoint mode of computational differentiation
Griewank A., Walther A. ACM Transactions on Mathematical Software 26(1): 19-45, 2000. Type: Article
Oct 1 2000
Evaluating derivatives: principles and techniques of algorithmic differentiation
Griewank A., Walther A., Society for Industrial and Applied Mathematics, Philadelphia, PA, 2008.  460, Type: Book (9780898716597)
Dec 12 2008

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy