# Harmonic balance

Harmonic balance is a method used to calculate the steady-state response of nonlinear differential equations,[1] and is mostly applied to nonlinear electrical circuits [2] [3] .[4] It is a frequency domain method for calculating the steady state, as opposed to the various time-domain steady state methods; the name "harmonic balance" is descriptive of the method, which starts with Kirchhoff's Current Law written in the frequency domain and a chosen number of harmonics. A sinusoidal signal applied to a nonlinear component in a system will generate harmonics of the fundamental frequency. Effectively the method assumes the solution can be represented by a linear combination of sinusoids, then balances current and voltage sinusoids to satisfy Kirchhoff's law; the method is commonly used to simulate circuits which include nonlinear elements,[5] and is most applicable to systems with feedback in which limit cycles occur.

Microwave circuits were the original application for harmonic balance methods in electrical engineering. Microwave circuits were well-suited because, historically, microwave circuits consist of many linear components which can be directly represented in the frequency domain, plus a few nonlinear components. System sizes were typically small. For more general circuits, the method was considered impractical for all but these very small circuits until the mid-1990s, when Krylov subspace methods were applied to the problem;[6][7] the application of preconditioned Krylov subspace methods allowed much larger systems to be solved, both in size of circuit and in numbers of harmonics. This made practical the present-day use of harmonic balance methods to analyze radio-frequency integrated circuits (RFICs).

## Algorithm

The harmonic balance algorithm is a special version of Galerkin's method, it is used for the calculation of periodic solutions of autonomous and non-autonomous differential-algebraic systems of equations. The treatment of non-autonomous systems is slightly simpler than the treatment of autonomous ones. A non-autonomous DAE system has the representation

${\displaystyle 0=F(t,x,{\dot {x}})}$

with a sufficiently smooth function ${\displaystyle F:\mathbb {R} \times \mathbb {C} ^{n}\times \mathbb {C} ^{n}\rightarrow \mathbb {C} ^{n}}$ where ${\displaystyle n}$ is the number of equations and ${\displaystyle t,x,{\dot {x}}}$ are placeholders for time, the vector of unknowns and the vector of time-derivatives.

The system is non-autonomous if the function ${\displaystyle t\in \mathbb {R} \mapsto F(t,x,{\dot {x}})}$ is not constant for (some) fixed ${\displaystyle x}$ and ${\displaystyle {\dot {x}}}$. Nevertheless, we require that there is a known excitation period ${\displaystyle T>0}$ such that ${\displaystyle t\in \mathbb {R} \mapsto F(t,x,{\dot {x}})}$ is ${\displaystyle T}$-periodic.

A natural candidate set for the ${\displaystyle T}$-periodic solutions of the system equations is the Sobolev space ${\displaystyle H_{\rm {per}}^{1}((0,T),\mathbb {C} ^{n})}$ of weakly differentiable functions on the interval ${\displaystyle [0,T]}$ with periodic boundary conditions ${\displaystyle x(0)=x(T)}$. We assume that the smoothness and the structure of ${\displaystyle F}$ ensures that ${\displaystyle F(t,x(t),{\dot {x}}(t))}$ is square-integrable for all ${\displaystyle x\in H_{\rm {per}}^{1}((0,T),\mathbb {C} ^{n})}$.

The system ${\displaystyle B:=\left\{\psi _{k}\mid k\in \mathbb {Z} \right\}}$ of harmonic functions ${\displaystyle \psi _{k}:=\exp \left(ik{\frac {2\pi t}{T}}\right)}$ is a Schauder basis of ${\displaystyle H_{\rm {per}}^{1}((0,T),\mathbb {C} ^{n})}$ and forms a :Hilbert basis of the Hilbert space ${\displaystyle H:=L^{2}([0,T],\mathbb {C} )}$ of square-integrable functions. Therefore, each solution candidate ${\displaystyle x\in H_{\rm {per}}^{1}((0,T),\mathbb {C} ^{n})}$ can be represented by a Fourier-series ${\displaystyle x(t)=\sum _{k=-\infty }^{\infty }{\hat {x}}_{k}\exp \left(ik{\frac {2\pi t}{T}}\right)}$ with Fourier-coefficients ${\displaystyle {\hat {x}}_{k}:={\frac {1}{T}}\int _{0}^{T}\psi _{k}^{*}(t)\cdot x(t)dt}$ and the system equation is satisfied in the weak sense if for every base function ${\displaystyle \psi \in B}$ the variational equation

${\displaystyle 0=\langle \psi ,F(t,x,{\dot {x}})\rangle _{H}:={\frac {1}{T}}\int _{0}^{T}\psi ^{*}(t)\cdot F(t,x,{\dot {x}})dt}$

is fulfilled. This variational equation represents an infinite sequence of scalar equations since it has to be tested for the infinite number of base functions ${\displaystyle \psi }$ in ${\displaystyle B}$.

The Galerkin approach to the harmonic balance is to project the candidate set as well as the test space for the variational equation to the finitely dimensional sub-space spanned by the finite base ${\displaystyle B_{N}:=\{\psi _{k}\mid k\in \mathbb {N} {\text{ with }}-N\leq k\leq N\}}$.

This gives the finite-dimensional solution ${\displaystyle x(t)=\sum _{k=-N}^{N}{\hat {x}}_{k}\psi _{k}(t)=\sum _{k=-N}^{N}{\hat {x}}_{k}\exp \left(ik{\frac {2\pi t}{T}}\right)}$ and the finite set of equations

${\displaystyle 0=\langle \psi _{k},F(t,x,{\dot {x}})\rangle \quad {\text{ with }}k=-N,\ldots ,N}$

which can be solved numerically.

In the special context of electronics the algorithm starts with Kirchhoff's current law written in the frequency-domain. To increase the efficiency of the procedure, the circuit may be partitioned into its linear and nonlinear parts, since the linear part is readily described and calculated using nodal analysis directly in the frequency domain.

First, an initial guess is made for the solution, then an iterative process continues:

1. Voltages ${\displaystyle V}$ are used to calculate the currents of the linear part, ${\displaystyle I_{\text{linear}}}$ in the frequency domain.
2. Voltages ${\displaystyle V}$ are then used to calculate the currents in the nonlinear part, ${\displaystyle I_{\text{nonlinear}}}$. Since nonlinear devices are described in the time domain, the frequency-domain voltages ${\displaystyle V}$ are transformed into the time domain, typically using inverse Fast Fourier transforms. The nonlinear devices are then evaluated using the time-domain voltage waveforms to produce their time-domain currents; the currents are then transformed back into the frequency domain.
3. According to Kirchhoff's circuit laws, the sum of the currents must be zero, ${\displaystyle \epsilon =I_{\text{linear}}+I_{\text{nonlinear}}=0}$. An iterative process, usually Newton iteration, is used to update the network voltages ${\displaystyle V}$ such that the current residual ${\displaystyle \epsilon }$ is reduced. This step requires formulation of the Jacobian ${\displaystyle {\tfrac {d\epsilon }{dV}}}$.

Convergence is reached when ${\displaystyle \epsilon }$ is acceptably small, at which point all voltages and currents of the steady-state solution are known, most often represented as Fourier coefficients.

## Tools

A harmonic-balance tool, named Agile, for microwave circuits is available for download. A parallelized version [8] was also developed, but this version is not available. Sandia National Labs developed Xyce, a high performance parallel electronic simulator that can perform harmonic balance analysis.

## References

1. ^ Deuflhard, Peter (2006). Newton Methods for Nonlinear Problems. Berlin: Springer-Verlag. Section 7.3.3.: Fourier collocation method.
2. ^ Gilmore, R. J.; Steer, M. B. (1991). "Nonlinear circuit analysis using the method of harmonic balance—A review of the art. Part I. Introductory concepts". Int. J. Microw. Mill.-Wave Comput.-Aided Eng. 1: 22–37. doi:10.1002/mmce.4570010104.
3. ^ Curtice, W. R., Ettenberg, M. (4–6 June 1985). "A Nonlinear GaAs FET Model for Use in the Design of Output Circuits for Power Amplifiers". IEEE International Microwave Symposium Digest (MTT-S). St. Louis, MO, USA: 405–408.CS1 maint: multiple names: authors list (link)
4. ^ Nakhla, Michel S.; Vlach, Jiri (February 1976). "A piecewise harmonic balance technique for determination of periodic response of nonlinear systems". IEEE Transactions on Circuits and Systems. CAS-23: 85–91. ISSN 0098-4094.
5. ^ Maas, Stephen A. (2003). Nonlinear microwave and RF circuits. Artech House. ISBN 978-1-58053-484-0.
6. ^ Feldmann, P.; Melville, B.; Long, D. (1996). Efficient frequency domain analysis of large nonlinear analog circuits. Proceedings of the Custom Integrated Circuits Conference. pp. 461–464. doi:10.1109/CICC.1996.510597. ISBN 978-0-7803-3117-4.
7. ^ Brachtendorf, H.G.; Welsch, G.; Laur, R. (1995). Fast simulation of the steady-state of circuits by the harmonic balance technique. Proceedings, International Symposium on Circuits and Systems. 2. p. 1388. doi:10.1109/ISCAS.1995.520406. ISBN 978-0-7803-2570-8.
8. ^ Rhodes, D.; Perlman, B. (May 1999). "Parallel computation for microwave circuit simulation". IEEE Transactions on Microwave Theory and Techniques. 45 (5): 587–592. doi:10.1109/22.575573.