# Tips & Tricks: Avoid Harmonic-Balance and SPICE software flaws for time-domain simulation

There are severe flaws within the Harmonic-Balance and SPICE programs now widely used. Mentioned as far back as within an abstract of Session WSO at the 2008 IEEE International Microwave Symposium:

"Even though nonlinear circuit-analysis software has been in use for many years, users still have difficulty obtaining valid results with existing methods. Recognized problems include poor accuracy, convergence difficulties, long simulation times, and unstable results (i.e., results that vary greatly with minor changes in parameters). These problems are encountered in both harmonic-balance and time-domain simulations."

The Harmonic-Balance software runs a series of simulations intended to converge to a correct final solution for the steady-state periodic response (i.e., the circuit operation after the start-up transient has died away and each period repeats the same as the preceding period). Sometimes the software functions properly however, frequently it does not and suffers the malfunctions described in the abstract of Session WSO, quoted in the above paragraph.

Engineers using SPICE time-domain software to find the steady-state periodic response, also have difficulties: they run the program for 100 to 1000 periods, depending on the Q (Quality Factor) of the resonant circuit at the operating frequency. That takes a long computing time, and it suffers from increasing errors, the longer the running time [1].

**Avoiding the flaws**

In the case of switching-mode power amplifiers, now a very popular application, those problems can be avoided *completely*, by using, instead of Harmonic Balance or SPICE, a mathematical algorithm for a direct computation of an *exact* solution for the steady-state periodic response [2] and subsequently improved [3]. This “Liou-Sokal” algorithm works for two reasons: (a) the algorithm is an exact analysis, and (b) the computations are executed in double precision, which gives correct results, even in nearly unstable cases. Amplifiers, built according to designs from that software, always perform within a few percent of the computed values, for approximately a thousand designs operating at frequencies from 1 MHz to 3 GHz.

In order to exploit the algorithm the present computation code can be replaced by a routine based on the Liou-Sokal algorithm. This routine is available and accounts for an approximate 9x improvement in speed when compared with programs based on the Harmonic-Balance method. The routine has been successfully used in designing and automatically optimizing high-efficiency switching-mode power amplifiers Class-E and Classes D and DE, and a high-efficiency resonant DC-DC converter.

REFERENCES

[1] Angelo Brambilla and Dario D’Amore, “The simulation errors introduced by the Spice transient analysis”, *IEEE Trans. Circuits and Systems-1: Fundamental Theory and Applications, *vol. 40, no. 1, Jan. 1993, pp. 57-60.

[2] Ming-Lei Liou, “Exact analysis of linear circuits containing periodically operated switches with applications”, *IEEE Trans. Circuit Theory,* vol. CT-19, no. 2, March 1972, pp. 146-154.

[3] Alan D. Sokal, “A remark on ‘Exact analysis of linear periodically operated switches with applications”, *IEEE Trans. Circuits and Systems,* vol. CAS-24, no. 10, Oct. 1977, pp. 575-577.

**About the Author**

**Nathan O. Sokal** was elected a Fellow of the IEEE in 1989, for his contributions to the technology of high-efficiency switching-mode power conversion and RF power amplification. In 2007, he received the Microwave Pioneer award from the IEEE Microwave Theory and Techniques Society, for his development of the Class-E RF power amplifier. In 1965, he founded Design Automation, Inc., a consulting company doing design review, product design, and solving “unsolvable” problems, for equipment manufacturers. He holds eight patents in power electronics, and is the author or co-author of three books and 130 technical papers, mostly on high-efficiency power electronics. He received B.S and M.S. degrees in Electrical Engineering from MIT. He is a Technical Adviser to the American Radio Relay League, on RF power amplifiers and dc power supplies, and a member of the honorary professional societies Electromagnetics Society, Eta Kappa Nu, and Sigma Xi.* * He can be reached at Nathan Sokal.