Welcome to OTIlib and pyoti documentation!#
The OTIlib and pyoti library is a C and Python library to support the Order Truncated Imaginary (OTI) algebra. OTI numbers were developed in the Ph.D. thesis “Order Truncated Imaginary Algebra for Computation of Multivariable High-Order Derivatives in Finite Element Analysis” (link). OTI numbers are an extension of Dual numbers. Dual numbers are a hypercomplex algebra that allows computing a single first order derivative per evaluation. OITs, is also a hypercomplex algebra, but in contrast to dual numbers, it can be used to compute efficient high-order derivatives with respect to multiple variables. In contrast to the Dual numbers ( \(a + b \epsilon, \epsilon^2 = 0\) ), OTI numbers set a truncation condition other than \(\epsilon^2 = 0\), and considers multiple imaginary basis. For instance \(\epsilon_1^5, \epsilon_1^2\epsilon_2, \ldots, \epsilon_m\) can be non-truncated imaginary directions.
More information on HYPAD#
Theory, references, lecture notes and other information on Hypercomplex-based Automatic Differentiation HYPAD.
Warning
This website is under construction. Documentation placed here may be incomplete.
Development is constantly being done to improve documentation.
Quick example:#
import pyoti.sparse as oti
import numpy as np
# Define variables and apply perturbations
x = np.pi/4 + oti.e(1,order=2)
# Evaluate function.
f = oti.sin(x)
print(f)
# >>> 0.707107 + 0.707107 * e([1]) - 0.353553 * e([[1,2]])
# Extract the function and its derivatives:
print(f'f(x): {f.real}')
print(f'df/dx: {f.get_deriv([1 ])}')
print(f'd^2f/dx^2: {f.get_deriv([1,1])}')
# >>> f(x): 0.7071067811865475
# >>> df/dx: 0.7071067811865476
# >>> d^2f/dx^2: -0.7071067811865475