Abstract
Differentiation is one of the most common subjects of numerical calculations. Gradients and Hessians are used in many problems of the physical and engineering sciences. Automatic differentiation (AD) is usually employed when the accuracy in derivatives calculations is important. When AD is implemented, there are no truncation or cancellation errors. Therefore, the derivatives are calculated with the available machine precision. In this study, the forward mode of AD by using dual numbers is implemented to develop efficient methods for computing velocities and accelerations. It is known that the reverse mode of AD is more efficient than the forward mode of AD to compute gradients and Hessians. Nonetheless, gradients and Hessians are not directly required for the calculation of velocities and accelerations. However, directional derivatives and the action of the Hessian operator on specific vectors are required. Both operations can be efficiently computed through the use of dual numbers.
Similar content being viewed by others
References
Griewank, A.: On automatic differentiation. In: Iri, M., Tanabe, K. (eds.) Mathematical Programming: Recent Developments and Applications. Kluwer, Dordrecht (1998)
Neidinger, R.D.: Introduction to automatic differentiation and MATLAB object-oriented programming. SIAM Rev. 52(3), 545–563 (2010)
Yu, W., Blair, M.: DNAD, a simple tool for automatic differentiation of Fortran codes using dual numbers. Comput. Phys. Commun. 184, 1446–1452 (2013)
Griewank, A.: Evaluating Derivatives, Principles and Techniques of Algorithmic Differentiation. Frontiers in Applied Mathematics, vol. 19. SIAM, Portland (2008)
Phipps, E., Pawlowski, R.: In: Efficient Expression Templates for Operator Overloading-Based Automatic Differentiation, pp. 309–319. Springer, Berlin (2012)
Pham-Quang, P., Delinchant, B.: In: Java Automatic Differentiation Tool Using Virtual Operator Overloading, pp. 241–250. Springer, Berlin (2012)
Werner, J., Hillenbrand, M., Hoffmann, A., Sinzinger, S.: Automatic differentiation in the optimization of imaging optical systems. Schedae Inform. 21, 169–175 (2012)
Hascoet, L., Pascual, V.: The tapenade automatic differentiation tool: Principles, model, and specification. ACM Trans. Math. Softw. 39(3), 20, 43 pp. (2013)
Walter, S.F., Lehmann, L.: Algorithmic differentiation in python with algopy. J. Comput. Sci. 4(5), 334–344 (2013)
Hogan, R.J.: Fast reverse-mode automatic differentiation using expression templates in C++. ACM Trans. Math. Softw. 40(4), 26, 16 pp. (2014)
Moré, J.J., Wild, S.M.: Do you trust derivatives or differences? J. Comput. Phys. 273, 268–277 (2014)
Li, X., Zhang, D.: A backward automatic differentiation framework for reservoir simulation. Comput. Geosci. 18(6), 1009–1022 (2014)
Khan, K.A., Barton, P.I.: A vector forward mode of automatic differentiation for generalized derivative evaluation. Optim. Methods Softw. 30(6), 1185–1212 (2015)
Naumann, U., Lotz, J., Leppkes, K., Towara, M.: Algorithmic differentiation of numerical methods: Tangent and adjoint solvers for parameterized systems of nonlinear equations. ACM Trans. Math. Softw. 41(4), 26, 21 pp. (2015)
Zubov, V.I.: Application of fast automatic differentiation for solving the inverse coefficient problem for the heat equation. Comput. Math. Math. Phys. 56(10), 1743–1757 (2016)
Weinstein, M.J., Rao, A.V.: A source transformation via operator overloading method for the automatic differentiation of mathematical functions in Matlab. ACM Trans. Math. Softw. 42(2), 11, 44 pp. (2016)
Sluşanschi, E.I., Dumitrel, V.: Adijac – automatic differentiation of Java classfiles. ACM Trans. Math. Softw. 43(2), 9, 33 pp. (2016)
Baydin, A.G., Pearlmutter, B.A., Radul, A.A., Siskind, J.M.: Automatic differentiation in machine learning: A survey. J. Mach. Learn. Res. 18(153), 1–43 (2018)
Bücker, M., Corliss, G., Hovland, P., Naumann, U. Norris, B. (eds.): Automatic Differentiation: Applications, Theory, and Implementations Springer, New York (2006)
Fike, J., Alonso, J.: The development of hyper-dual numbers for exact second-derivative calculations. AIAA Paper 2011-886. https://doi.org/10.2514/6.2011-886
Tanaka, M., Sasagawa, T., Omote, R., Fujikawa, M., Balzani, D., Schröder, J.: A highly accurate 1st- and 2nd-order differentiation scheme for hyperelastic material models based on hyper-dual numbers. Comput. Methods Appl. Mech. Eng. 283, 22–45 (2015)
Clifford, W.: Preliminary sketch of biquaternions. Proc. Lond. Math. Soc. 1(1–4), 381–395 (1873)
Pennestrì, E., Stefanelli, R.: Linear algebra and numerical algorithms using dual numbers. Multibody Syst. Dyn. 18, 323–344 (2007)
Frydryszak, A.M.: Dual numbers and supersymmetric mechanics. Czechoslov. J. Phys. 55(11), 1409–1414 (2005)
Gremse, F., Höfter, A., Razik, L., Kiessling, F., Naumann, U.: Gpu-accelerated adjoint algorithmic differentiation. Comput. Phys. Commun. 200, 300–311 (2016)
Møller, M.: Exact calculation of the product of the Hessian matrix of feed-forward network error functions and a vector in 0(n) time. DAIMI Report Series 22 (432)
Pearlmutter, B.A.: Fast exact multiplication by the Hessian. Neural Comput. 6(1), 147–160 (1994)
Peñuñuri, F.: Additional material to article: Dual numbers and automatic differentiation to efficiently compute velocities and accelerations. https://doi.org/10.17632/zwxpjbjz44.1
Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes in Fortran 77. The Art of Scientific Computing, vol. 1, 2nd edn. Cambridge University Press, Cambridge (1995)
Martins, J.R.R.A., Sturdza, P., Alonso, J.J.: The complex-step derivative approximation. ACM Trans. Math. Softw. 29(3), 245–262 (2003)
Stejskal, V., Valasek, M.: Kinematics and Dynamics of Machinery (Mechanical Engineering). CRC Press, Boca Raton (1996)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Peñuñuri, F., Peón, R., González–Sánchez, D. et al. Dual Numbers and Automatic Differentiation to Efficiently Compute Velocities and Accelerations. Acta Appl Math 170, 649–659 (2020). https://doi.org/10.1007/s10440-020-00351-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10440-020-00351-9