Algebraic Harmonic Balance Method
This project provides a Python 3.10 implementation of the algebraic harmonic balance method (algebraic HBM, aHBM) as proposed here.
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
Minimal working example
A MWE can be found here. Below is a slighlty more extensive version of said example.
Required imports:
from ode import ODE_2nd_Order_Poly_Coeffs
from harmonic_balance_method 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