Skip to main content
Article thumbnail
Location of Repository

An Efficient overloaded implementation of forward mode automatic differentiation in MATLAB

By Shaun A. Forth


The Mad package described here facilitates the evaluation of first derivatives of multi-dimensional functions that are defined by computer codes written in MATLAB. The underlying algorithm is the well-known forward mode of automatic differentiation implemented via operator overloading on variables of the class fmad. The main distinguishing feature of this MATLAB implementation is the separation of the linear combination of derivative vectors into a separate derivative vector class derivvec. This allows for the straightforward performance optimisation of the overall package. Additionally by internally using a matrix (two-dimensional) representation of arbitrary dimension directional derivatives we may utilise MATLAB"s sparse matrix class to propagate sparse directional derivatives for MATLAB code which uses arbitrary dimension arrays. On several examples the package is shown to be more efficient than Verma"s ADMAT package.© ACM, 2006. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in ACM Transactions on Mathematical Software (TOMS) Volume 32 , Issue 2 (June 2006) 195 - 222, 2006 ISSN:0098-3500

Publisher: ACM Association for Computing Machinery
Year: 2006
DOI identifier: 10.1145/1141885.1141888
OAI identifier:
Provided by: Cranfield CERES

Suggested articles


  1. (2004). Accepted Aug. 2005.Efficient Forward Mode
  2. (2001). AD tools and prospects for optimal AD in CFD flux Jacobian calculations. In Automatic Differentiation: From Simulation to doi
  3. (1997). ADIC — An extensible automatic differentiation tool for ANSI-C. doi
  4. (1996). ADIFOR 2.0: Automatic differentiation of Fortran 77 programs. doi
  5. (1998). ADMAT: An automatic differentiation toolbox for MATLAB. doi
  6. (1998). ADMAT: Automatic differentiation in MATLAB using object oriented methods.
  7. (2000). ADMIT-1: Automatic differentiation and MATLAB interface toolbox. doi
  8. (1998). ADO1, a Fortran 90 code for automatic differentiation.
  9. (1996). Algorithm 755: ADOL–C, a package for the automatic differentiation of algorithms written in C/C++. doi
  10. (2003). Automatic differentiation for MATLAB programs. doi
  11. (1992). Automatic differentiation in MATLAB. doi
  12. (2001). Automatic Differentiation: From Simulation to Optimization. Computer and Information Science.
  13. (2004). Chapter 19: The TOMLAB optimization environment. doi
  14. (2002). Combining source transformation and operator overloading techniques to compute derivatives for MATLAB programs. doi
  15. (1999). Efficient calculation of Jacobian matrices by optimized application of the chain rule to computational graphs.
  16. (1996). Efficient computations of gradients and Jacobians by dynamic exploitation of sparsity in automatic differentiation. doi
  17. (2000). Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. doi
  18. (2002). Improved fitting of constrained multivariate regression models using automatic differentiation. doi
  19. (2004). Jacobian code generated by source transformation and vertex elimination can be as efficient as hand-coding. doi
  20. (1999). Numerical Optimization. Springer series in operational research. doi
  21. (2000). On efficient solutions to the continuous sensitivity equation using automatic differentiation. doi
  22. (1991). On the calculation of Jacobian matrices by the Markowitz rule.
  23. (2004). Optimal accumulation of Jacobian matrices by elimination methods on the dual computational graph. doi
  24. (2003). Optimization Toolbox User’s Guide, Version 2. doi
  25. (1991). Ordinary Differential Equations II, Stiff and DifferentialAlgebraic Problems. doi
  26. (2004). revised
  27. (2001). Semantic augmentation of MATLAB programs to compute derivatives.
  28. (2004). Simplifying multivariate second order response surfaces by fitting constrained models using automatic differentiation. Technometrics Accepted. doi
  29. (2004). Source transformation for automatic differentiation in MATLAB. doi
  30. (1992). Sparse matrices in MATLAB: Design and implementation. doi
  31. (1996). Structure and efficient Jacobian calculation. doi
  32. (1998). Structured automatic differentiation. doi
  33. (1998). The efficient computation of sparse Jacobian matrices using automatic differentiation. doi
  34. (1997). The MATLAB ODE suite. doi
  35. (2003). The TAPENADE tutorial tutorial.html. Web Site.
  36. (2004). The use of numerical optimisation to determine on-limit handling behaviour of race cars.
  37. Transformation of Algorithms in Fortran, Manual, Draft Version,
  38. (2001). User guide for MAD - a Matlab automatic differentiation toolbox.
  39. (2004). User Guide for MAD - MATLAB Automatic Differentiation Toolbox TOMLAB/MAD, Version 1.1 The Forward Mode.
  40. (2004). User’s guide for TOMLAB 4.3.
  41. (2005). Using AD to solve BVPs in MATLAB. doi
  42. (2003). Using Matlab, Version 6. doi

To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.