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
Usage
Evaluation
This example shows how to use the algebraic HBM framework for a softening Duffing oscillator that generates the executable functions
from algebraic_hbm import ODE_2nd_Order_Poly_Coeffs, softening_Duffing, Algebraic_HBM
Calling import softening_Duffing
importes an instance of the ODE_2nd_Order_Poly_Coeffs
-class that represents classical softening Duffing oscillator
This can also be achieved by instead calling
softening_Duffing = ODE_2nd_Order_Poly_Coeffs(mass=1, damping=.4, stiffness=1, excitation=(0,.3), monomials={3: -.4})
Then, initialize the algebraic HBM for the softening Duffing oscillator and ansatz order
HBM = Algebraic_HBM(ODE=softening_Duffing, order=n)
Now generate the multivariate polynomials that define the algebraic equation system
HBM.generate_multivariate_polynomials()
Finally, compile the polynomials into excecutable functions
F, DF = HBM.compile()
The functions
Coefficient matrix for Macaulay framework
This example shows how to build the coefficient matrix of the algebraic representation (again, see Theoretic background) 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
.
from algebraic_hbm import softening_Duffing, Algebraic_HBM
n, a = 1, 3.14
HBM = Algebraic_HBM(ODE=softening_Duffing, order=n)
HBM.generate_multivariate_polynomials()
A = HBM.get_monomial_coefficient_matrix(a)
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
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