This hands-on workshop will introduce the use of complex and hypercomplex numbers for automatic differentiation (AD) of numerical and symbolic functions. This method for AD, called HYPAD, has significant advantages, in that
- the methodology is employed “in-place” – that is, the underlying algorithm is merely “augmented” with imaginary degrees of freedom while keeping the fundamental computational implementation largely otherwise unaltered,
- the methodology provides machine precision accuracy, that is, the error in the sensitivities is solely due to the numerical algorithm in which it is employed, and
- once a code is “hypercomplexified”, no further changes are required to assess any numerical derivative, that is, one does not “predefine” the derivative to compute.
The workshop will cover in detail the use of complex and dual numbers to compute first order sensitivities and hypercomplex bidual numbers to compute 2nd order sensitivities. Extensions to any order sensitivities will also be presented. A working example for a linear elastic finite element analysis will be presented.
The course will be conducted interactively using Python examples and the MultiZ library. Attendees are encouraged to bring a laptop to the course and to download the materials beforehand.
Note - Attendees will obtain a copy of the MultiZ library which can compute arbitrary-order sensitivities for the Python and Fortran languages. Introductory knowledge of Python expected.
HYPAD Workshop Outline
Introduction to HYPAD and course materials
Complex Taylor series expansion (CTSE) method
- CTSE formulation
- Analogy with the finite difference method
- Exercises with simple functions
- Step size study
Numerical integration Application Study
- Simpson’s rule
- Gauss-Legendre quadrature
Newton-Rhapson solver Application Study
ODE solver Application Study
Cauchy-Reimann form
Break
Dual numbers for first order sensitivities
- Definition of dual numbers
- Exercises with simple functions
- Step size study
Numerical integration Application Study
Cauchy-Reimann form
Lunch
Bidual numbers for 2nd order sensitivities
- Basic operations
Exercises with simple functions
- Step size study
Numerical integration Application Study
Newton-Rhapson solver Application Study
Cauchy-Reimann form
Higher order sensitivities
Finite element considerations