For the numerical solution of problems arising in various fields of mathematics and mechanics, it is often necessary to determine the values of derivatives included in the model. Currently, numerical values of derivatives can be obtained using automatic differentiation libraries in many programming languages. This paper discusses the use of the Python programming language, which is widely used in the scientific community. It should be noted that the principles of automatic differentiation are not related to numerical or symbolic differentiation methods. The work consists of three parts. The introduction reviews the historical development of the general theory of complex numbers and the use of simple complex, double and dual numbers, which are a subset of the set of general complex numbers, in various fields of mathematics. The second part is devoted to the algebra of dual and hyperdual numbers and their properties. This section presents tables of the basis element of elementary functions with dual and hyperdual arguments, based on multiplication rules. Two important formulas for finding the numerical values of a complex function's first and second derivatives by expanding functions with dual and hyperdual arguments in the Taylor series are also obtained. A simple test function was used to verify the correctness of these formulas, the results of which were checked analytically as well as through implementation in a programming language. The third part of the paper focuses on practical applications and the implementation of these methods in Python. It includes detailed examples of case studies demonstrating the effectiveness of using hyperdual numbers in automatic differentiation. The results highlight the accuracy and computational efficiency of these methods, making them valuable tools for researchers and engineers. This comprehensive approach not only validates the theoretical aspects but also showcases the practical utility of dual and hyperdual numbers in solving complex mathematical and mechanical problems.
Read full abstract