Skip to main content
Log in

Dual Numbers and Automatic Differentiation to Efficiently Compute Velocities and Accelerations

  • Published:
Acta Applicandae Mathematicae Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2

Similar content being viewed by others

References

  1. Griewank, A.: On automatic differentiation. In: Iri, M., Tanabe, K. (eds.) Mathematical Programming: Recent Developments and Applications. Kluwer, Dordrecht (1998)

    Google Scholar 

  2. Neidinger, R.D.: Introduction to automatic differentiation and MATLAB object-oriented programming. SIAM Rev. 52(3), 545–563 (2010)

    Article  MathSciNet  Google Scholar 

  3. Yu, W., Blair, M.: DNAD, a simple tool for automatic differentiation of Fortran codes using dual numbers. Comput. Phys. Commun. 184, 1446–1452 (2013)

    Article  Google Scholar 

  4. Griewank, A.: Evaluating Derivatives, Principles and Techniques of Algorithmic Differentiation. Frontiers in Applied Mathematics, vol. 19. SIAM, Portland (2008)

    Book  Google Scholar 

  5. Phipps, E., Pawlowski, R.: In: Efficient Expression Templates for Operator Overloading-Based Automatic Differentiation, pp. 309–319. Springer, Berlin (2012)

    MATH  Google Scholar 

  6. Pham-Quang, P., Delinchant, B.: In: Java Automatic Differentiation Tool Using Virtual Operator Overloading, pp. 241–250. Springer, Berlin (2012)

    MATH  Google Scholar 

  7. Werner, J., Hillenbrand, M., Hoffmann, A., Sinzinger, S.: Automatic differentiation in the optimization of imaging optical systems. Schedae Inform. 21, 169–175 (2012)

    Google Scholar 

  8. Hascoet, L., Pascual, V.: The tapenade automatic differentiation tool: Principles, model, and specification. ACM Trans. Math. Softw. 39(3), 20, 43 pp. (2013)

    Article  MathSciNet  Google Scholar 

  9. Walter, S.F., Lehmann, L.: Algorithmic differentiation in python with algopy. J. Comput. Sci. 4(5), 334–344 (2013)

    Article  Google Scholar 

  10. Hogan, R.J.: Fast reverse-mode automatic differentiation using expression templates in C++. ACM Trans. Math. Softw. 40(4), 26, 16 pp. (2014)

    Article  MathSciNet  Google Scholar 

  11. Moré, J.J., Wild, S.M.: Do you trust derivatives or differences? J. Comput. Phys. 273, 268–277 (2014)

    Article  Google Scholar 

  12. Li, X., Zhang, D.: A backward automatic differentiation framework for reservoir simulation. Comput. Geosci. 18(6), 1009–1022 (2014)

    Article  Google Scholar 

  13. 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)

    Article  MathSciNet  Google Scholar 

  14. 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)

    Article  MathSciNet  Google Scholar 

  15. 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)

    Article  MathSciNet  Google Scholar 

  16. 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)

    Article  MathSciNet  Google Scholar 

  17. Sluşanschi, E.I., Dumitrel, V.: Adijac – automatic differentiation of Java classfiles. ACM Trans. Math. Softw. 43(2), 9, 33 pp. (2016)

    Article  MathSciNet  Google Scholar 

  18. 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)

    MathSciNet  MATH  Google Scholar 

  19. Bücker, M., Corliss, G., Hovland, P., Naumann, U. Norris, B. (eds.): Automatic Differentiation: Applications, Theory, and Implementations Springer, New York (2006)

    Google Scholar 

  20. 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

  21. 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)

    Article  MathSciNet  Google Scholar 

  22. Clifford, W.: Preliminary sketch of biquaternions. Proc. Lond. Math. Soc. 1(1–4), 381–395 (1873)

    MathSciNet  MATH  Google Scholar 

  23. Pennestrì, E., Stefanelli, R.: Linear algebra and numerical algorithms using dual numbers. Multibody Syst. Dyn. 18, 323–344 (2007)

    Article  MathSciNet  Google Scholar 

  24. Frydryszak, A.M.: Dual numbers and supersymmetric mechanics. Czechoslov. J. Phys. 55(11), 1409–1414 (2005)

    Article  MathSciNet  Google Scholar 

  25. Gremse, F., Höfter, A., Razik, L., Kiessling, F., Naumann, U.: Gpu-accelerated adjoint algorithmic differentiation. Comput. Phys. Commun. 200, 300–311 (2016)

    Article  Google Scholar 

  26. 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)

  27. Pearlmutter, B.A.: Fast exact multiplication by the Hessian. Neural Comput. 6(1), 147–160 (1994)

    Article  Google Scholar 

  28. 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

  29. 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)

    MATH  Google Scholar 

  30. Martins, J.R.R.A., Sturdza, P., Alonso, J.J.: The complex-step derivative approximation. ACM Trans. Math. Softw. 29(3), 245–262 (2003)

    Article  MathSciNet  Google Scholar 

  31. Stejskal, V., Valasek, M.: Kinematics and Dynamics of Machinery (Mechanical Engineering). CRC Press, Boca Raton (1996)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to F. Peñuñuri.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10440-020-00351-9

Keywords

Mathematics Subject Classification

Navigation