Algebraic Harmonic Balance Method
This package provides a Python 3.10 implementation of the algebraic harmonic balance method (algebraic HBM) as proposed by [1].
Installation
The following commands install algebraic_hbm
from the Python Package Index. You will need a working installation of Python
and pip
.
pip install algebraic-hbm
Theoretic background
We are considering second order ordinary differential equations (ODEs) with polynomial coefficients in the state
The idea of the HBM is to yield approximations
where
with basis functions
Usage
Evaluation
This example shows how to use the algebraic HBM framework to generate a system of executable functions that can be evaluated. This example can also be found here.
Required imports:
import algebraic_hbm
Define the classical softening Duffing oscillator
as a second order ODE with polynomial coefficients via
ode = ODE_2nd_Order_Poly_Coeffs(mass=1, damping=.4, stiffness=1, excitation=(0,.3), monomials={3: -.4})
Then, initialize the algebraic HBM for ansatz order
HBM = Algebraic_HBM(ODE=ode, order=n)
Now generate the multivariate polynomials that define the algebraic equation system of the algebraic HBM.
HBM.generate_multivariate_polynomials()
Compile multivariate polynomials into excecutable functions
F, DF = HBM.compile()
The system
Coefficient matrix for Macaulay framework
This example shows how to build the coefficient matrix of the algebraic representation that can be used in conjunction with the Macaulay matrix framework [4]. This example can also be found here.
Most of the steps are as in the above example, but instead of compiling executable functions we request the coefficient matrix at a given excitation frequency
HBM.get_monomial_coefficient_matrix
.
import algebraic_hbm
n, a = 1, 3.14
ode = ODE_2nd_Order_Poly_Coeffs(mass=1, damping=.4, stiffness=1, excitation=(0,.3), monomials={3: -.4})
HBM = Algebraic_HBM(ODE=ode, order=n)
HBM.generate_multivariate_polynomials()
A = HBM.get_monomial_coefficient_matrix(a)
References
- Hannes Dänschel and Lukas Lentz. "An Algebraic Representation of the Harmonic Balance Method for Ordinary Differential Equations with Polynomial Coefficients". Manuscript PDF: /algebraic_hbm.pdf
- Malte Krack and Johann Gross. "Harmonic Balance for Nonlinear Vibration Problems". Springer, 2019. isbn: 978-3-030-14022-9. DOI: 10.1007/978-3-030-14023-6
- Hannes Dänschel, Lukas Lentz, and Utz von Wagner. "Error Measures and Solution Artifacts of the Harmonic Balance Method on the Example of the Softening Duffing Oscillator". In: Journal of Theoretical and Applied Mechanics 62.2 (Apr. 2024), pp. 435–455. DOI: 10.15632/jtam-pl/186718
- Philippe Dreesen, Kim Batselier, and Bart De Moor. "Back to the Roots: Polynomial System Solving, Linear Algebra, Systems Theory". In: IFAC Proceedings Volumes 45.16 (2012), pp. 1203–1208. issn: 1474-6670. DOI: 10.3182/20120711-3-BE-2027.00217