# 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 vs1 ... vs,M to the interconnection currents i1 ... iN. The second one (Y) relates the interconnection voltages v1 ... vN to the interconnection currents i1 . iN. Taking both, we can express the current flowing through the interconnections between the linear and non-linear sub-circuit: Because Vs is known and constant, the first term can already be computed to give Is. 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 v0j1, ..., vK,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 v1 ... vN are at the interconnections of the two sub-circuits. With these values, the voltages at all nodes can be calculated.

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.