# The Theory of Harmonic Balance Used in a Nonlinear Circuit

As the non-linear elements are still modeled in the time domain, the circuit must first be separated into linear and non-linear parts (repetition - this is mentioned in the previous paragraph). The internal impedances Zi of the voltage sources are also put into the linear part. Figure 3.3 illustrates a conceptual circuit diagram for using harmonic balance in a non-linear circuit. The following symbols can be defined as: ^{•}

M = number of (independent) voltage sources

- • N = number of connections between the linear and non-linear sub-circuit
- • K = number of calculated harmonics
- • L = number of nodes in the linear sub-circuit

Figure 3.3 The circuit diagram for using harmonic balance in a non-linear circuit

The linear circuit is modeled by two transadmittance matrices. The first one *(Ys) *relates the source voltages v_{s1} ... v_{s},_{M} to the interconnection currents *i** _{1}* ...

*i*The second one

_{N}.*(Y)*relates the interconnection voltages v

_{1}... v

_{N}to the interconnection currents

*i*

_{1}.

*i*

_{N}. Taking both, we can express the current flowing through the interconnections between the linear and non-linear sub-circuit:

Because V_{s} is known and constant, the first term can already be computed to give I_{s}. Taking the whole linear network as one block is called the “piecewise” harmonic balance technique.

The non-linear circuit is modeled by its current function: and by the charge of its capacitances:

These functions must be Fourier-transformed to give the frequency-domain vectors *Q *and respectively.

The non-linear equation system can be solved by the following equation, where the first term is the linear section and the second term is the nonlinear section:

where matrix ^ contains the angular frequencies on the first main diagonal and zeros anywhere else, and 0 is the zero vector.

After each iteration step, the inverse Fourier transformation must be applied to the voltage vector V. Following this, the time domain voltages v_{0j1}, ..., *v _{K},_{N}* are put into (3-3) and (3-4), before a Fourier transformation gives the vectors

*Q*and Ig for the next iteration step. After repeating this several times, a simulation result can be found. This result means the voltages v

_{1}...

*v*are at the interconnections of the two sub-circuits. With these values, the voltages at all nodes can be calculated.

_{N}One significant difference between the harmonic balance and conventional simulation types (such as DC or AC simulation) is the structure of the matrices and vectors. A vector used in a conventional simulation contains one value for each node. In harmonic balance simulation, there are many harmonics and, thus, a vector contains *K* values for each node. This means that, within a matrix, there is a *K* x *K* diagonal sub-matrix for each node. Using this structure, all equations can be written in the usual way - that is, without paying attention to the special matrix and vector structure. In a computer program, however, a special matrix class is needed, in order to conserve memory for the off-diagonal zeros.