Abstract
The Mad package described here facilitates the evaluation of first derivatives of multidimensional 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 optimization of the overall package. Additionally, by internally using a matrix (two-dimensional) representation of arbitrary dimension directional derivatives, we may utilize 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 [Verma 1998a].
- Berz, M., Bischof, C., Corliss, G., and Griewank, A., Eds. 1996. Computational Differentiation: Techniques, Applications, and Tools. SIAM, Philadelphia, PA.Google Scholar
- Bischof, C., Bücker, H., Lang, B., Rasch, A., and Vehreschild, A. 2002. Combining source transformation and operator overloading techniques to compute derivatives for MATLAB programs. In Proceedings of the 2nd IEEE International Workshop on Source Code Analysis and Manipulation (SCAM'02). IEEE Computer Society, 65--72. Google Scholar
- Bischof, C., Lang, B., and Vehreschild, A. 2003. Automatic differentiation for MATLAB programs. In Proceedings in Applied Mathematics and Mechanics 2, 1 John Wiley, 50--53.Google Scholar
- Bischof, C. H., Carle, A., Khademi, P., and Mauer, A. 1996. ADIFOR 2.0: Automatic differentiation of Fortran 77 programs. IEEE Computa. Science Engin. 3, 3, 18--32. Google Scholar
- Bischof, C. H., Khademi, P. M., Bouaricha, A., and Carle, A. 1996. Efficient computations of gradients and Jacobians by dynamic exploitation of sparsity in automatic differentiation. Optimiz. Meth. Softw. 7, 1--39.Google Scholar
- Bischof, C. H., Roh, L., and Mauer, A. 1997. ADIC---An extensible automatic differentiation tool for ANSI-C. Softw.---Pract. Exper. 27, 12, 1427--1456. www-fp.mcs.anl.gov/adic/. Google Scholar
- Borggaard, J. and Verma, A. 2000. On efficient solutions to the continuous sensitivity equation using automatic differentiation. SIAM J. Sci. Comput. 22, 1, 39--62. Google Scholar
- Bradshaw, D. 2004. The use of numerical optimisation to determine on-limit handling behaviour of race cars. Ph.D. thesis, School of Engineering, Department of Automotive, Mechanical and Structural Engineering, Cranfield University, Bedfordshire, UK.Google Scholar
- Coleman, T. F. and Verma, A. 1996. Structure and efficient Jacobian calculation. In Computational Differentiation: Techniques, Applications, and Tools, M. Berz, C. Bischof, G. Corliss, and A. Griewank, Eds. SIAM, Philadelphia, PA, 149--159.Google Scholar
- Coleman, T. F. and Verma, A. 1998a. ADMAT: An automatic differentiation toolbox for MATLAB. Tech. rep., Computer Science Department, Cornell University. Google Scholar
- Coleman, T. F. and Verma, A. 1998b. The efficient computation of sparse Jacobian matrices using automatic differentiation. SIAM J. Sci. Comput. 19, 4, 1210--1233. Google Scholar
- Coleman, T. F. and Verma, A. 2000. ADMIT-1: Automatic differentiation and MATLAB interface toolbox. ACM Trans. Math. Softw. 26, 1 (March) 150--175. Google Scholar
- Corliss, G., Faure, C., Griewank, A., Hascoët, L., and Naumann, U., Eds. 2001. Automatic Differentiation: From Simulation to Optimization. Computer and Information Science. Springer, New York, NY. Google Scholar
- FastOpt 2003. Transformation of Algorithms in Fortran, Manual, Draft Version, TAF Version 1.6. FastOpt. http://www.FastOpt.com/taf.Google Scholar
- Forth, S. A. 2001. User guide for MAD---a Matlab automatic differentiation toolbox. Applied Mathematics and Operational Research Report AMOR 2001/5 (June) Cranfield University (RMCS Shrivenham), Swindon, UK.Google Scholar
- Forth, S. A. and Edvall, M. M. 2004. User Guide for MAD - MATLAB Automatic Differentiation Toolbox TOMLAB/MAD, Version 1.1 The Forward Mode. TOMLAB Optimization Inc., San Diego, CA. http://tomlab.biz/products/mad.Google Scholar
- Forth, S. A. and Ketzscher, R. 2004. High-level interfaces for the MAD (Matlab Automatic Differentiation) package. In 4th European Congress on Computational Methods in Applied Sciences and Engineering (ECCOMAS), P. Neittaanmäki, T. Rossi, S. Korotov, E. Oñate, J. Périaux, and D. Knörzer, Eds. Vol. 2. University of Jyväskylä, Department of Mathematical Information Technology, Finland.Google Scholar
- Forth, S. A., Tadjouddine, M., Pryce, J. D., and Reid, J. K. 2004. Jacobian code generated by source transformation and vertex elimination can be as efficient as hand-coding. ACM Trans. Math. Softw. 30, 3 (Sep.) 266--299. http://doi.acm.org/10.1145/1024074.1024076. Google Scholar
- Gilbert, J. R., Moler, C., and Schreiber, R. 1992. Sparse matrices in MATLAB: Design and implementation. SIAM J. Matrix Analy. Appl. 13, 1 (Jan.), 333--356. Google Scholar
- Griewank, A. 2000. Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. Frontiers in Applied Mathematics, No. 19. SIAM, Philadelphia, PA. Google Scholar
- Griewank, A., Juedes, D., and Utke, J. 1996. Algorithm 755: ADOL--C, a package for the automatic differentiation of algorithms written in C/C++. ACM Trans. Math. Softw. 22, 2, 131--167. Google Scholar
- Griewank, A. and Reese, S. 1991. On the calculation of Jacobian matrices by the Markowitz rule. In Automatic Differentiation of Algorithms: Theory, Implementation, and Application, A. Griewank and G. F. Corliss, Eds. SIAM, Philadelphia, PA, 126--135.Google Scholar
- Hairer, E. and Wanner, G. 1991. Ordinary Differential Equations II, Stiff and Differential-Algebraic Problems. Springer-Verlag, Berlin, Germany.Google Scholar
- Holmström, K. and Edvall, M. M. January 2004. Chapter 19: The TOMLAB optimization environment. In Modeling Languages in Mathematical Optimization, J. Kallrath, Ed. APPLIED OPTIMIZATION 88. Kluwer Academic Publishers, Boston, MA.Google Scholar
- Holmström, K., Göran, A. O., and Edvall, M. M. 2004. User's guide for TOMLAB 4.3. TOMLAB Optimization Inc., San Diego, CA. http://www.tomlab.biz.Google Scholar
- Kharche, R. V. 2004. Source transformation for automatic differentiation in MATLAB. M.S. thesis, Cranfield University (Shrivenham Campus), Applied Mathematics & Operational Research Group, Engineering Systems Department (RMCS Shrivenham), Swindon, UK. Google Scholar
- Naumann, U. 1999. Efficient calculation of Jacobian matrices by optimized application of the chain rule to computational graphs. Ph.D. thesis, Technical University of Dresden.Google Scholar
- Naumann, U. 2004. Optimal accumulation of Jacobian matrices by elimination methods on the dual computational graph. Math. Program. 99, 3 (April), 399--421. Google Scholar
- Nocedal, J. and Wright, S. J. 1999. Numerical Optimization. Operational Research Series. Springer-Verlag, New York, NY.Google Scholar
- Pryce, J. D. and Reid, J. K. 1998. ADO1, a Fortran 90 code for automatic differentiation. Tech. Rep. RAL-TR-1998-057, Rutherford Appleton Laboratory, Chilton, UK. ftp://matisa.cc.rl.ac.uk/ pub/reports/prRAL98057.ps.gz.Google Scholar
- Rich, L. C. and Hill, D. R. 1992. Automatic differentiation in MATLAB. App. Num. Math. 9, 33--43. Google Scholar
- Ringrose, T. J. and Forth, S. A. 2002. Improved fitting of constrained multivariate regression models using automatic differentiation. In Proceedings in Computational Statistics, 15th Symposium (COMPSTAT'02), W. Hardle and B. Ronz, Eds. Physica-Verlag, Berlin, Germany, 383--388.Google Scholar
- Ringrose, T. J. and Forth, S. A. 2005. Simplifying multivariate second order response surfaces by fitting constrained models using automatic differentiation. Technometrics 47, 3, 249--259.Google Scholar
- Shampine, L. and Reichelt, M. 1997. The MATLAB ODE suite. SIAM J. Sci. Comput. 18, 1--22. Google Scholar
- Shampine, L. F., Ketzscher, R., and Forth, S. A. 2005. Using AD to solve BVPs in MATLAB. ACM Trans. Math. Softw. 31, 1 (March), 79--94. Google Scholar
- Tadjouddine, M., Forth, S. A., and Pryce, J. D. 2001. AD tools and prospects for optimal AD in CFD flux Jacobian calculations. In Automatic Differentiation: From Simulation to Optimization, G. Corliss, C. Faure, A. Griewank, L. Hascoët, and U. Naumann, Eds. Computer and Information Science. Springer, New York, NY, 247--252. Google Scholar
- Tapenade 2003. The TAPENADE tutorial. http://www-sop.inria.fr/tropics/tapenade/ tutorial.html.Google Scholar
- The MathWorks Inc. 2003. Using Matlab, Version 6. The MathWorks Inc., MA.Google Scholar
- The Mathworks Inc. Sept 2003. Optimization Toolbox User's Guide, Version 2. The Mathworks Inc., Natick MA.Google Scholar
- Vehreschild, A. 2001. Semantic augmentation of MATLAB programs to compute derivatives. Diploma Thesis, Institute for Scientific Computing, Aachen University, Germany.Google Scholar
- Verma, A. 1998a. ADMAT: Automatic differentiation in MATLAB using object oriented methods. In SIAM Interdisciplinary Workshop on Object Oriented Methods for Interoperability. SIAM, National Science Foundation, Yorktown Heights, New York, 174--183.Google Scholar
- Verma, A. 1998b. Structured automatic differentiation. Ph.D. thesis. Department of Computer Science, Cornell University, Ithaca, NY. Google Scholar
Index Terms
- An efficient overloaded implementation of forward mode automatic differentiation in MATLAB
Recommendations
Using AD to solve BVPs in MATLAB
The MATLAB program bvp4c solves two--point boundary value problems (BVPs) of considerable generality. The numerical method requires partial derivatives of several kinds. To make solving BVPs as easy as possible, the default in bvp4c is to approximate ...
PID Control of Inverted Pendulum Using Adams and Matlab Co-Simulation
ICCMA '16: Proceedings of the 4th International Conference on Control, Mechatronics and AutomationThis research is aimed at developing a multi-body simulation model and control of an inverted pendulum. A virtual prototype of the inverted pendulum is built by using MSC Adams software and the plant model is exported to MATLAB. It is co-simulated in ...
A MATLAB differentiation matrix suite
A software suite consisting of 17 MATLAB functions for solving differential equations by the spectral collocation (i.e., pseudospectral) method is presented. It includes functions for computing derivatives of arbitrary order corresponding to Chebyshev, ...
Comments