You are on page 1of 8

HBM for dummies

A. Grolet1
1
Department of Mechanical Engineering, Imperial College London
E-mail: a.grolet@imperial.ac.uk

Abstract: This document present shortly the harmonic balance method in the context of structural dynamics. The theory is
illustrated with simple examples.
Keywords: harmonic balance method (HBM), non-linear vibration, Fourier series

Contents

1 Introduction 1
1.1 A linear oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 A non linear oscillator: Duffing’s oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Harmonic Balance Method 4


2.1 Dynamic System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 HBM method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.2 Substitution and projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Sum Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Simple exemples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 minimal implementation 6
3.1 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.1 Forced Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

4 Annexe:condensed form of the equation 6


4.1 vector form of the equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 matrix form of the equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1 Introduction

1.1 A linear oscillator


Let start by recalling some facts about linear oscillators. The equation of motion is given by:

mü + cu̇ + ku = f (t) (1)

where u(t) is the displacement as a function of time, f (t) is the external force, m, c, k are respectively the mass,
the damping and the stiffness coefficients of the system. In order to be complete, some initial conditions for the
displacement and the velocity, say at t = 0, have to be provided.
Solutions u∗ of this linear differential equation are the sum of the homogeneous solution u0 (solution with
zero forcing and initial conditions) and the particular solution up (solution with forcing, independent of initial
conditions): u∗ = u0 + up . When there is no damping, u0 is a sinusoidal signal which oscillates at the resonance
frequency and which amplitude and phase are determined by the initial conditions. When there is damping (c ̸= 0),
solutions u0 are exponentially damped and goes to zero as the time increases, so that they can be discarded in this
case.
In the most general case of external forcing, a systematic way of finding a particular solution is to use Laplace
transform. Here we will restrain our consideration to the case of a periodic force. Actually, since a periodic signal
can be decomposed into a Fourier series, which is a sum of harmonic signal, it is sufficient to consider harmonic
forcing. consequently f (t) will be expressed as f (t) = F sin(ωt), with F and ω the amplitude and the angular
frequency of the harmonic excitation.
The problem is now to find a solution of the following equation

mü + cu̇ + ku = F sin(ωt) (2)


It seems natural to search for a solution which is also periodic and with the same period as the excitation: u(t) =
A cos(ωt) + B sin(ωt). Substituting into Eq.(2) leads to:
( ) ( )
(k − ω 2 m)A + ωcB cos(ωt) + − ωcA + (k − ω 2 m)B sin(ωt) = F sin(ωt) (3)

Balancing the harmonic coefficients of the cosine and sine on each side of the equation lead to the following linear
system with two unknowns:
[ ][ ] [ ]
(k − ω 2 m) ωc A 0
= (4)
−ωc (k − ω 2 m) B F

Solving the linear system gives the value for A and B:

−ωcF (k − ω 2 )F
A= , B = (5)
(k − ω 2 m)2 + ω 2 c2 (k − ω 2 m)2 + ω 2 c2
Eventually, the particular solution for harmonic forcing is given by the following:
F ( )
u(t) = (−ωc) cos(ωt) + (k − ω 2 m) sin(ωt) (6)
(k − ω 2 m)2 + ω 2 c2
This simple example shows that the particular solution under harmonic forcing can be obtained by following
these steps:
• search for a periodic solution
• substitute into the differential equation
• balance coefficients of the sine and cosine
• solve the linear algebraic system
This procedure is basically the core of the harmonic balance method. However, it has to be adapted in order to take
into account the specificities of non-linear systems. Those specificities will be described in the next example.

Note: The previous results can be rearranged so that the solution is expressed with the more familiar phase-
amplitude form: u(t) = U sin(ωt + ϕ) with:

F ωc
U=√ , and ϕ = − tan−1 ( ) (7)
(k − ω ) + ω c
2 2 2 2 k − ω2 m

Note: If there is no forcing, the system in Eq.4 reduced to the following


[ ][ ] [ ]
(k − ω 2 m) ωc A 0
= (8)
−ωc (k − ω 2 m) B 0

There are non-trivial solutions only if the determinant of the matrix is zero:

(k − ω 2 m)2 + ω 2 c2 = 0 (9)

which correspond to a particular angular frequency. If there is no damping (c = 0), this corresponds to the
k
resonance frequency: ωr2 = m . If c is not zero, solving the equation leads to frequency which is complex,
reflecting the fact that the solution of the homogeneous system are damped and thus goes to zero as t increases.
Note: If we consider a more general forcing with a continuous component (i.e. a static force) a cosine and a
sine term: f (t) = F0 + Fc cos(ωt) + Fs sin(ωt) the solution can be found by the same procedure. However, one
has to add a constant term to the solution: u(t) = A0 + A cos(ωt) + B sin(ωt). A third equation is generated
by balancing the coefficient of the "zeros-th harmonic", i.e. the constant function t 7→ 1, leading to the following
system:     
k 0 0 A0 F0
 0 (k − ω 2 m) ωc   A  =  Fc  (10)
0 −ωc (k − ω 2 m) B Fs
Note: In this presentation, we used a real formalism. However, it can also be done using a complex formalism
which allow to transform the linear system in Eq(4). into a single complex equation.
1.2 A non linear oscillator: Duffing’s oscillator
Lets consider the case of an simple non-linear oscillator, the so called Duffing oscillator, which consist in an
oscillator with a cubic non-linearity on the displacement:

mü + cu̇ + ku + ξu3 = F cos(ωt) (11)

First some remarks about the equation itself. The biggest difference with the linear case is that the equation does
not verify the linear superposition theorem which states that a linear combination of solution is also a solution. In
our case, the cubic term prevents this theorem to work. In particular, the solution cannot be decomposed into a
homogeneous solution and a particular solution, everything has to be computed "at once".
In order to illustrates the particularity of the non-linearity we will consider an undamped system at first (c =
0). Since there is no damping, the solution should be in phase with the excitation, and should have the same
fundamental frequency. Let’s try an approximation u b(t) = A cos(ωt)
Substituting into the undamped equation of motion one get:

A(k − ω 2 m) cos(ωt) + ξA3 cos(ωt)3 = F cos(ωt) + r(t) (12)

where r(t) is a residual introduced by the fact that u b(t) is only an approximation of the exact solution u(t).
Developing the cubic term gives:
3 1
cos3 (ωt) = cos(ωt) + cos(3ωt) (13)
4 4
at this point we observe that the non-linearity generates new harmonics (here the third) that we wont be able to
balance unless we include new harmonics in the approximation.
Substituting the cubic developmental into the motion equation and "balancing the harmonic" gives:
( 3 ) 1
(k − ω 2 m)A + ξA3 − f cos(ωt) + ξA3 cos(3ωt) = r(t) (14)
4 4
At this point we choose to "discard" the third harmonic. This is justified as long as 41 ξA3 is not too hight. Equating
the coefficient of the cosine to zero gives
3
A(k − ω 2 m) + A3 ξ = f (15)
4
This equation gives the amplitude of the solution as a function of the forcing frequency. Since the equation is
cubic, an interesting fact is that there could be more than one amplitude for the same excitation frequency (in this
case at most 3 real solutions, depending on the frequency).
The fact that we discard the third harmonic can be justified more rigorously. In Eq.(17) we are interested in
making the residual as small as possible. In the case of the HBM, the solution is chosen such that the projection of
the residual onto the sub-space spanned by the generating functions is null. In other words, the residual is imposed
to be orthogonal to the space generated by the cosine function:
∫ T
1
(cos1 , r) = cos(ωt)r(t)dt = 0 (16)
T 0

with cos1 the function cos1 : t 7→ cos(1ωt).


Applying the orthogonality condition (16) to the residual (17) leads to the following:
∫ ∫ ∫
1 T ( 3 )1 T
1 1 T
0= cos(ωt)r(t)dt = (k − ω 2 m)A + ξA3 − f cos2 (ωt)dt + ξA3 cos(ωt) cos(3ωt)dt
T 0 4 T 0 4 T 0
(17)
computing the two integrals in the last equation lead exactly to Eq.(15) since the set [cos1 , cos3 ] is orthogonal w.r.t
the scalar product in (16).
Note: Equation (15) is an approximation that remains valid as long as 41 ξA3 is not too hight. Otherwise, one
need to include the third harmonic in the approximation. However, even if we introduce the third harmonic, higher
harmonic will be generated (namely the fifth) that will not be balance by a third harmonic approximation, and so
on... Consequently, the exact solution can only be obtained with an infinite number of harmonics. In practice, the
series is truncated so that we obtain an approximation of the solution.
2 Harmonic Balance Method

The HBM is a particular case of more general method called Ritz-Galerkin method. This method∑ is based on
variable separation such that a solution of a dynamic system D(U (t)) = 0 is seached for as a U (t) = k Φk qk (t)
with Φk space functions (vector) and qk (t) time functions.
In the case of the HBM the time function are known (the Fourier basis) and we search for the coefficients
Φk ’s by imposing orthogonality of the residual with the space spanned by the qk (t)’s with relation to the following
scalar product:
∫ T
(qk , qn ) = 1/T qk (t)qn (t)dt (18)
0

The imposition of orthogonality conditions for the residual (namely (qk , r) = 0 ∀k) lead to a set of algebraic
equations. After truncation on the number of basis function, the solution(s) of the (non-linear) algebraic equation
then gives an approximation of the solution of the dynamic system.
Note that in modal synthesis, which is also based on a Ritz method ,it is the reverse, ie the coefficients are
known (mode shapes) and we search for the time function.

2.1 Dynamic System


After discretisation, the equation of motion for a non-linear structure can be put under the following general
form:
M Ü + C U̇ + KU + Fnl (U, U̇ ) = F (t) (19)
M,C, K are the mass, damping and stiffness matrices associated with the discretisation of the problem. Fnl (U, U̇ )
represents the non-linear forces and F (t) the external forces. In the first read, U (t) can be viewed as the displace-
ment of a single dof system. But the equations are also valid for N-dof systems if we consider (K, M, C) as matrix
and Fnl , F as vector of dimension N .

2.2 HBM method


2.2.1 Approximation
b is searched for under the form of the HBM approximation, it reads :
An approximated solution U


H
b (t) = U
U e0 + ekc cos(kωt) + U
U eks sin(kωt) (20)
k=1

Here U e0 , U
e c, U
e s are the Fourier coefficients of the approximation. Note that the development is truncated to H
k k
harmonics so that a total of (2H + 1) coefficients has to be searched for. In the case of a N-dof system the formula
is still valid if we allow U e0 , U
e c, U
e s to be vectors of size N , in this case (2H + 1)N coefficients has to be searched
k k
for.
At this point ω can be viewed as the fundamental frequency of a periodic excitation. Note however that during
free vibration ω is unknown a priori, and has to be considered as a variable, this case will be detailed afterwards.
Using (44), the expression for the velocity (derivative with respect to time) is :


H
ḃ (t) =
U eks cos(kωt) − U
kω(U ekc sin(kωt)) (21)
k=1

and the expression for the acceleration (differentiate twice with respect to time) is:


H
b̈ (t) =
U ekc cos(kωt) + U
−(kω)2 (U eks sin(kωt)) (22)
k=1
2.2.2 Substitution and projections
Substituting into the dynamic equation, grouping sine (resp. cosine) terms together gives:

e0 +
KU
H [
∑ ]
e c + kωC U
(K − (kω)2 M )U e s cos(kωt)+
k k
k=1
H [
∑ ] (23)
eks − kωC U
(K − (kω)2 M )U ekc sin(kωt)+
k=1

b (t), U
Fnl (U ḃ (t)) =
F (t) + R(t)

b (t) is only an approximation of the solution (not an exact


Here R(t) is the residual induced by the fact that U
solution) of the dynamic problem. Most of the time the residual cannot be set to zero, but we can try to minimise it
relative to different criteria. When using the HBM, the residual is imposed to be orthogonal to the space generated
by the Fourier basis, which leads to algebraic equation.
The imposition of orthogonality of the residual with respect to the function t → 1 (also called, projection on
the "zero-th harmonic") gives:
e0 + Fenl,0 = Fe0
KU (24)
with Fenl,0 the mean value of the non-linear forces given by:
∫ T
1
Fenl,0 = b (t), U
Fnl (U ḃ (t)) dt (25)
T 0

The imposition of orthogonality of the residual with respect to the functions t → cos(kωt) and t → sin(kωt)
(also called projection on the k-th harmonic) for 1 ≤ k ≤ H gives :

e c + kωC U
((K − (kω)2 M )U e s + Fec = Fe c
k k nl,k k
e s − kωC U
e c + Fes = Fe s (26)
((K − (kω)2 M )U k k nl,k k

with Fenl,k
c
, Fenl,k
s
the k-th Fourier coefficient of the non-linear forces defined as (the same definitions hold for Fe ). :
∫T
Fenl,k
c
= 1
T
b (t), U
cos(kωt) Fnl (U ḃ (t)) dt
∫0T (27)
e s
Fnl,k = 1 b (t), U
sin(kωt) Fnl (U ḃ (t)) dt
T 0

Note that in Eq.(24) and Eq.(29) we have used the fact that the basis of time function (Fourier basis) is a set of
orthogonal vector for the scalar product defined by the integral over one period.

2.3 Sum Up

In the end the application of the HBM consider approximate solutions Ub under the form of a truncated Fourier
series:

H
b e
U (t) = U0 + Uekc cos(kωt) + U
eks sin(kωt) (28)
k=1

and returns a set of algebric equations given by

KUe0 + Fenl,0 = Fe0


((K − (kω)2 M )U e s + Fec = Fec , 1 ≤ k ≤ H
e c + kωC U (29)
k k nl,k k
((K − (kω)2 M )U e c + Fes = Fes , 1 ≤ k ≤ H
e s − kωC U
k k nl,k k

where characters accented with tilde corresponds to the coefficients (means value, cosines, sines) of the Fourier
series associated with the respective (ie un-tilde) time function
2.4 Simple exemples
Lets consider the case of a harmonically forced duffing oscillator:

M Ü + C U̇ + KU + K3 U 3 = F sin(ωt) (30)

Lets use H = 1 harmonics for the approximation. Since there is no static force, the mean value U e0 can be set
b e c e s
to zero, leading simply to U (t) = U1 cos(ωt) + U1 sin(ωt) = A cos(ωt) + B sin(ωt), where a and b have been
introduced to shorten notations.
In this particular case, the evaluation of the Fourier coefficient for the non-linearity can be done analytically.
We use the relation T = 2π ω
∫ 2π/ω
Fenl,1
c
= ω
cos(ωt) K3 (A cos(ωt) + B sin(ωt))3 dt = 34 K3 A(A2 + B 2 )

∫02π/ω (31)
e s
Fnl,1 = ω
sin(ωt) K3 (A cos(ωt) + B sin(ωt))3 dt = 43 K3 B(A2 + B 2 )
2π 0

In the end the system of algebraic equations resulting from application of the HBM with one harmonic is given
by the following:
[ ][ ] [ ] [ ]
K − ω2 M ωC A 3 2 2 A 0
+ K3 (A + B ) = (32)
−ωC K − ω2 M B 4 B F

The system contains 2 equations and has 2 unknowns A and B. In this case ω is a parameter (the excitation
frequency) that can be fixed to any value. The system is non-linear and solutions can be found using Newton-like
Algorithm (e.g. fsolve.m in matlab) for a fixed ω.
In this particular √
example, Eq.() can be rearranged in order to obtain a single equation for the amplitude of the
approximation Y = A2 + B 2 ≥ 0:
[ ]
3
Y (K − ω M + K3 Y ) + ω C = F 2
2 2 2 2 2 2
(33)
4

This equation is of degree 3 with relation to Y 2 , which indicate that there could be 1, 2 or 3 solutions for Y 2 (hence
for Y ) depending on the parameter (ω) and the force (F ) value.

2.5
Let consider a 2-dof systems U = (u1 , u2 ) given by the following matrix and nonlinearity:
[ ] [ ] [ ] [ 3 ]
1 0 2 −1 0.01 0 u1
M= , K= C= Fnl (U ) = (34)
0 1 −1 2 0 0.01 u32

3 minimal implementation

here the implementation have been kept minimal to focus on the main point of the HBM programmation.

3.1 Algorithm
3.1.1 Forced Response
e

4 Annexe:condensed form of the equation

4.1 vector form of the equation


b (t) = Q(t)U
The approximation (44) is written as the matrix-vector product U e where Q(t) is given by the
matrix of size N × N (2H + 1):
[ ]
Q(t) = 1, cos(ωt), sin(ωt), . . . , cos(Hωt), sin(Hωt) ⊗ IN (35)
e is the column vector of size N (2H + 1) given by the concatenation of (2H + 1) vectors of size N :
and U
 
Ue0
 c 
 U e 
 1 
 U es 
e = 1 
U (36)
 ... 
 
 U c 
 eH 
es
U H

Expression for the velocity:


ḃ (t) = Q(t)∇U
U e (37)
Here ∇ can be seen as the (truncated) differential operator in the frequency domain. It acts on a matrix of Fourier
e and gives the Fourier coefficients of the tine derivative. It is given by the following matrix of size
coefficient U
(2H + 1)N × (2H + 1)N :
[ ]
0 kω
∇ = diag(0, ∇1 , . . . , ∇H ) ⊗ IN , with ∇k = (38)
−kω 0
Expression for the acceleration:
b̈ (t) = Q(t)∇2 U
U e (39)
Substitution into dynamic equation in contracted form:
[ ]
M Q(t)∇2 + CQ(t)∇ + KQ(t) U e + Fnl (U ḃ (t)) = F (t) + R(t)
b (t), U (40)

The projections onto the different harmonic can be done all at once by multipliying by the transpose of Q and
integrate over the period, its gives:
∫ [ ] ∫ T ∫ T
1 T e+ 1 ḃ (t))dt = 1
b (t), U
Q(t)t M Q(t)∇2 + CQ(t)∇ + KQ(t) dt U Qt (t)Fnl (U Qt (t)F (t)dt
T 0 T 0 T 0
(41)
After computation of the first integral, and introducing the non-linear and excitation force in the frequency
domain, the expanded form reads: :
      
K 0 0 0 0 0 e0
U Fenl,0 Fe0
   c   ec   c 
 0 K − ω2 M ωC ... 0 0  U e   F   Fe1 
   1   nl,1   
 0 −ωC K − ω M ...
2
0 0  U e s   Fenl,1 s   Fes 
 .   1 +  =  1 
 . .. .. .. .. ..  ...   ...   ... 
 . . . . . .      
  U c   c   c 
 0 0 0 . . . K − (Hω)2 M HωC   eH   Fenl,H   FeH 
0 0 0 ... −HωC K − (Hω)2 M Ues Fenl,H
s FeHs
H
(42)
which is simply another way of writing the system in Eq.(29), or in short form:
e + Fenl (U
Z(ω)U e ) = Fe (43)

4.2 matrix form of the equation


The approximation is written as:

H
b (t) = U
U e0 + ekc cos(kωt) + U
U eks sin(kωt) = U
e Q(t) (44)
k=1

b (t) = U
The approximation can be written in condensed form as U e Q(t) where Q(t) is given by the column vector
of size 2H + 1:  
1
 cos(ωt) 
 
 sin(ωt) 
Q(t) = 


 (45)
 ... 
 cos(Hωt) 
sin(Hωt)
e is given by the N × (2H + 1) matrix of coefficient)
and U
[ ]
e= U
U e0 , U
e c, U
e s, . . . , U es
ec , U (46)
1 1 H H

Expression for the velocity:


ḃ (t) = U
U e ∇Q(t) (47)
Here ∇ can be seen as the (truncated) differential operator in the frequency domain. It acts on a matrix of Fourier
e and gives the Fourier coefficients of the tine derivative. It is given by the following matrix of size
coefficient U
2H + 1: [ ]
0 kω
∇ = diag(0, ∇1 , . . . , ∇H ), with ∇k = (48)
−kω 0
Expression for the acceleration:
U e ∇2 Q(t)
b̈ (t) = U (49)
Substitution into dynamic equation in contracted form:
[ ]
MUe ∇2 + C Ue∇ + KU e Q(t) + Fnl (U
b (t), U
ḃ (t)) = F (t) + R(t) (50)

The projections onto the different harmonic can be done all at once by multipliying by the transpose of Q and
integrate over the period, its gives:
[ ] ∫ T ∫
1 T
∫ T
e ∇2 + C U
MU e 1
e∇ + KU Q(t)Qt (t)dt + ḃ (t))Qt (t)dt = 1
b (t), U
Fnl (U F (t)Qt (t)dt (51)
T 0 T 0 T 0

You might also like