Abstract
An object-oriented method is presented that computes without truncation the error derivatives of functions defined by MATLAB computer codes. The method implements forward-mode automatic differentiation via operator overloading in a manner that produces a new MATLAB code that computes the derivatives of the outputs of the original function with respect to the differentiation variables. Because the derivative code has the same input as the original function code, the method can be used recursively to generate derivatives of any order desired. In addition, the approach developed in this article has the feature that the derivatives are generated by simply evaluating the function on an instance of the class, thus making the method straightforward to use while simultaneously enabling differentiation of highly complex functions. A detailed description of the method is presented and the approach is illustrated and shown to be efficient on four examples.
- Abramowitz, M. and Stegun, I. 1965. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. Dover, New York.Google Scholar
- Benson, D. A., Huntington, G. T., Thorvaldsen, T. P., and Rao, A. V. 2006. Direct trajectory optimization and costate estimation via an orthogonal collocation method. J. Guidance, Control, Dynam. 29, 6, 1435--1440.Google Scholar
- Betts, J. T. 2009. Practical Methods for Optimal Control and Estimation Using Nonlinear Programming. SIAM, Philadelphia, PA. Google ScholarDigital Library
- Biegler, L. T. and Zavala, V. M. 2008. Large-scale nonlinear programming using IPOPT: An integrating framework for enterprise-wide optimization. Comput. Chem. Eng. 33, 3, 575--582.Google ScholarCross Ref
- Bischof, C. H., Bücker, H. M., 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, Los Alamitos, CA, 65--72. Google ScholarDigital Library
- Bischof, C. H., Carle, A., Corliss, G. F., Griewank, A., and Hovland, P. D. 1992. ADIFOR: Generating derivative codes from Fortran programs. Sci. Program. 1, 1, 11--29. Google ScholarDigital Library
- Bischof, C. H., Carle, A., Khademi, P., and Mauer, A. 1996. ADIFOR 2.0: Automatic differentiation of Fortran 77 programs. IEEE Comput. Sci. Eng. 3, 3, 18--32. Google ScholarDigital Library
- Cayuga Research 2008--2009. ADMAT: Automatic Differentiation Toolbox User's Guide, Version 2.0. Cayuga Research.Google Scholar
- Coleman, T. F. and Verma, A. 1998a. ADMAT: An automatic differentiation toolbox for MATLAB. Tech. rep., Computer Science Department, Cornell University. Google ScholarDigital Library
- Coleman, T. F. and Verma, A. 1998b. ADMIT-1: Automatic differentiation and MATLAB interface toolbox. ACM Trans. Math. Softw. 26, 1, 150--175. Google ScholarDigital Library
- Darby, C. L., Hager, W. W., and Rao, A. V. 2011a. Direct trajectory optimization using a variable loworder adaptive pseudospectral method. J. Spacecraft Rockets 48, 3, 433--445.Google ScholarCross Ref
- Darby, C. L., Hager, W. W., and Rao, A. V. 2011b. An hp--adaptive pseudospectral method for solving optimal control problems. Optimal Control Appl. Meth. 32, 4, 476--502.Google ScholarCross Ref
- Dobmann, M., Liepelt, M., and Schittkowski, K. 1995. Algorithm 746: PCOMP: A Fortran code for automatic differentiation. ACM Trans. Math. Softw. 21, 3, 233--266. Google ScholarDigital Library
- Duff, I. S. 2004. MA57—A code for the solution of sparse symmetric definite and indefinite systems. ACM Trans. Math. Softw. 30, 2, 118--144. Google ScholarDigital Library
- Forth, S. A. 2006. An efficient overloaded implementation of forward mode automatic differentiation in MATLAB. ACM Trans. Math. Softw. 32, 2, 195--222. Google ScholarDigital Library
- 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, 4, 266--299. Google ScholarDigital Library
- Garg, D., Hager, W. W., and Rao, A. V. 2011a. Pseudospectral methods for solving infinite-horizon optimal control problems. Automatica 47, 4, 829--837. Google ScholarDigital Library
- Garg, D., Patterson, M. A., Darby, C. L., Francolin, C., Huntington, G. T., Hager, W. W., and Rao, A. V. 2011b. Direct trajectory optimization and costate estimation of finite-horizon and infinite horizon optimal control problems via a Radau pseudospectral method. Comput. Optim. Appl. 49, 2, 335--358. Google ScholarDigital Library
- Garg, D., Patterson, M. A., Hager, W. W., Rao, A. V., Benson, D. A., and Huntington, G. T. 2010. A unified framework for the numerical solution of optimal control problems using pseudospectral methods. Automatica 46, 11, 1843--1851. Google ScholarDigital Library
- Griewank, A. 2008. Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. Frontiers in Appl. Mathematics. SIAM, Philadelphia, PA. Google ScholarDigital Library
- 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 ScholarDigital Library
- Hascoët, L. and Pascual, V. 2004. TAPENADE 2.1 User's Guide. Rapport Technique 300, INRIA, Sophia Antipolis.Google Scholar
- Kharche, R. V. 2011. MATLAB automatic differentiation using source transformation. Ph.D. dissertation, Department of Informatics, Systems Engineering, Applied Mathematics, and Scientific Computing, Cranfield University.Google Scholar
- Kharche, R. V. and Forth, S. A. 2006. Source transformation for MATLAB automatic differentiation. In Computational Science, Lecture Notes in Computer Science, vol. 3994, N. Alexandrov et al. Eds., Springer, Berlin, 558--565. Google ScholarDigital Library
- Lantoine, G., Russell, R. P., and Dargent, T. 2012. Using multicomplex variables for automatic computation of high-order derivatives. ACM Trans. Math. Softw. 38, 3, 16:1--16:21. Google ScholarDigital Library
- Martins, J. R. R. A., Sturdza, P., and Alonso, J. J. 2003. The complex-step derivative approximation. ACM Trans. Math. Softw. 29, 3, 245--262. Google ScholarDigital Library
- MathWorks. 2010. Version R2010b. The MathWorks Inc., Natick, MA.Google Scholar
- Monagan, M. B., Geddes, K. O., Heal, K. M., Labahn, G., Vorkoetter, S. M., Mccarron, J., and Demarco, P. 2005. Maple 10 Programming Guide. Maplesoft, Waterloo ON, Canada.Google Scholar
- Neidinger, R. D. 2010. Introduction to automatic differentiation and MATLAB object-oriented programming. SIAM Rev. 52, 3, 545--563. Google ScholarDigital Library
- Padulo, M., Forth, S. A., and Guenov, M. D. 2008. Robust aircraft conceptual design using automatic differentiation in MATLAB. In Advances in Automatic Differentiation, C. H. Bischof et al. Eds., Lecture Notes in Computer Science, vol. 64, Springer, Berlin, 271--280.Google Scholar
- Patterson, M. A. and Rao, A. V. 2012. Exploiting sparsity in direct collocation pseudospectral methods for solving continuous-time optimal control problems. J. Spacecraft Rockets, 49, 2, 364--377.Google ScholarCross Ref
- Rao, A. V., Benson, D. A., Christopher Darby, M. A. P., Francolin, C., Sanders, I., and Huntington, G. T. 2010. Algorithm 902: GPOPS, A MATLAB software for solving multiple-phase optimal control problems using the Gauss pseudospectral method. ACM Trans. Math. Softw. 37, 2, 22:1--22:39. Google ScholarDigital Library
- Rao, A. V., Benson, D. A., Darby, C. L., Mahon, B., Francolin, C., Patterson, M. A., Sanders, I., and Huntington, G. T. 2011. User's Manual for GPOPS Version 4.x: A MATLAB Software for Solving Multiple-Phase Optimal Control Problems Using hp--Adaptive Pseudospectral Methods. http://www.gpops.org.Google Scholar
- Rump, S. M. 1999. Intlab -- INTerval LABoratory. In Developments in Reliable Computing, T. Csendes, Ed., Kluwer, Amsterdam, 77--104.Google Scholar
- Shampine, L. F. 2007. Accurate numerical derivatives in MATLAB. ACM Trans. Math. Softw. 33, 4, 26:1--26:17. Google ScholarDigital Library
- Speelpenning, B. 1980. Compiling fast partial derivatives of functions given by algorithms. Ph.D. dissertation, University of Illinois at Urbana-Champaign. Google ScholarDigital Library
- Tadjouddine, M., Forth, S. A., Pryce, J. D., and Reid, J. K. 2002. Performance issues for vertex elimination methods in computing jacobians using automatic differentiation. In Proceedings of the International Conference on Computational Science-Part II. ICCS'02. Springer, Berlin, 1077--1086. Google ScholarDigital Library
- Waechter, A. and Biegler, L. T. 2006. On the implementation of a primal-dual interior-point filter line search algorithm for large-scale nonlinear programming. Math. Program. 106, 1, 575--582. Google ScholarDigital Library
- Wolfram. 2008. Mathematica Edition: Version 7.0. Wolfram Research, Champaign, IL.Google Scholar
Index Terms
- An efficient overloaded method for computing derivatives of mathematical functions in MATLAB
Recommendations
A Source Transformation via Operator Overloading Method for the Automatic Differentiation of Mathematical Functions in MATLAB
A source transformation via operator overloading method is presented for computing derivatives of mathematical functions defined by MATLAB computer programs. The transformed derivative code that results from the method of this article computes a sparse ...
GPOPS-II: A MATLAB Software for Solving Multiple-Phase Optimal Control Problems Using hp-Adaptive Gaussian Quadrature Collocation Methods and Sparse Nonlinear Programming
A general-purpose MATLAB software program called GPOPS--II is described for solving multiple-phase optimal control problems using variable-order Gaussian quadrature collocation methods. The software employs a Legendre-Gauss-Radau quadrature orthogonal ...
On the method of modified equations. II: Numerical techniques based on the equivalent equation for the Euler forward difference method
New numerical successive-correction techniques for ordinary differential equations based on the Euler forward explicit method and the first modified or equivalent equation are presented. These techniques are similar to iterative updating deferred ...
Comments