Hom 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

SIMPLE IMPLEMENTATIONS OF HOMOTOPY ALGORITHMS FOR FINDING DC

SOLUTIONS OF NONLINEAR CIRCUITS

E. Chan, H. Hofmann, W. Horia


A. Dyess y Lj. Trajković 
EECS Department
ECE Department School of Engineering Science
University of California
University of Alabama Simon Fraser University
Berkeley, CA 94720-1770
Tuscaloosa, AL 35487 Burnaby, BC, V5A 1S6, Canada
chan1, heath, wjwh
ad3160@labs.eng.ua.edu ljilja@cs.sfu.ca
@cory.eecs.berkeley.edu

ABSTRACT We describe here simple software implementations of


We describe simple software implementations of parameter homotopy algorithms using the MATLAB software pack-
embedding (also called continuation and homotopy) algo- age [13]. In spite of it simplicity, our implementation proved
rithms for calculating dc operating points of nonlinear cir- powerful enough to solve benchmark nonlinear circuits with
cuits. Past implementation of homotopy algorithms in in- multiple operating points.
dustrial circuit simulators proved that they were viable op-
tions to resolving convergence difficulties when finding cir- 2. HOMOTOPY METHODS: BACKGROUND
cuits’ dc operating points. These software implementations
involved proprietary circuit simulation tools and sophisti- Homotopy methods are used to solve systems of nonlinear
cated software implementation of homotopy algorithms. The algebraic equations and can be applied to a large variety of
implementation described here, relies on commercially avail- problems. We are most interested in solving the zero finding
able MATLAB tools. In spite of its simplicity, our imple- problem
mentation proved powerful enough to solve benchmark non- F (x) = 0; (1)
where x 2 Rn, F : Rn ! Rn . (Note that the fixed point
linear circuits with multiple dc operating points.
problem can be easily reformulated as a zero finding prob-
1. INTRODUCTION lem.)
We create the homotopy function H(x; ) by embed-
Parameter embedding methods are robust and accurate nu- ding a parameter  into F (x) and thus obtaining an equa-
merical techniques for solving nonlinear algebraic equations tion of higher dimension
[1], [2]. They can be used to find multiple solutions of equa-
tions that possess more than one solution [3]. A class of H(x; ) = 0; (2)
embedding algorithms called probability-one homotopy al-
gorithms that promise global convergence [4] have been im- where  2 R, H : Rn  R ! Rn. For  = 0,
plemented in a publicly available software package HOM-
PACK [5]. Past research and implementations of homotopy H(x; 0) = 0 (3)
algorithms for finding circuit dc operating points indicated
promising results [6]-[11]. These algorithms have been used is an easy equation to solve, and for  = 1,
to find solutions to highly nonlinear circuits that could not
be simulated [12] using conventional numerical methods.
H(x; 1) = 0 (4)
They are also useful in finding dc operating points of mul- is the original problem (1). The parameter  is called the
tistable circuits. The main drawback in using homotopy continuation or homotopy parameter.
methods is their computational intensity. Therefore, they An example of a homotopy is
are most suitable for solving difficult nonlinear problems
where initial solutions are hard to estimate or multiple so- H(x; ) = (1 ; )G (x) + F (x): (5)
lutions are desired. For circuits that fall in this category,
homotopy algorithms offer a very attractive alternative. Hence, H(x; 0) := G (x) = 0 has an easy solution, while
This work was supported by the y Computing Research Association
H(x; 1) := F (x) = 0 is our original problem. By follow-
Distributed Mentor Project, and the  National Science Foundation under ing solutions of H(x; ) = 0 as  varies from 0 to 1, we
Grant GER-9550153. reach the solution to F (x) = 0.
The solutions trace a path known as the zero curve. Var- with conditions

k d dx
ious numerical problems may occur depending on the be-
havior of this curve. One problem occurs if the curve folds (0) = 0; x(0) = a; and ;
ds ds 2
k = 1: (9)
back. At the turning point the values of  decrease as the
path progresses. Increasing  from 0 to 1 results in “losing”
Differential equation (8) can be written as
 
the curve. The difficulty is resolved by making  a function @H @H 
d dx  :
P(y)y_ := ds ds (10)
of a new parameter: the arc length s. This method is known @ @x
as the arc length continuation [2], [5]. We wish to solve
P(y)y_ = 0 (11)
3. DC OPERATING POINT ANALYSIS for y_ . The solution is unique if the extended Jacobian matrix
(8) is of full rank. Conditions (9) define the starting point
We used homotopy methods to find the dc operating points for x, the starting value of , and ensure that the sign and
of nonlinear circuits. This method of solving equations was the magnitude of y_ are fixed in the implementation. The
implemented through the use of two software programs. First, solution y_ is found by solving linear differential equation
a parser generates the mathematical equations from a de- (11) using standard linear solvers via the QR factorization
scription of the circuit in the commonly used SPICE for- algorithm [18].
mat [14], [15]. These equations are then solved by a MAT- Once the derivatives are determined, we used the variable-
LAB tool [13]. We tested the method by solving Chua’s step predictor-corrector method to find y(s) from its deriva-
four-transistor benchmark circuit [16]. As expected, nine tive that were found in the previous step. The method proved
distinct solutions were found. superior to the Runge-Kutta methods that we initially used.
Finally, the “end game” was used to determine the step
size so that the solution to y(s) for  = 1 can be reached. A
cubic spline interpolation of (s) and a solution to (s) = 1
3.1. Parser
Implementation of the homotopy method requires that the (the smallest root that is greater than the current value of s)
set of equations that describe the circuit be specified. Only were used to predict the next step size. Once  is within the
for very simple circuits, these equations can be written by preselected tolerance, the value of x was assumed to be the
hand. The parser is a C++ program that accepts a SPICE sought solution.
input file [14], [15], and produces either nodal analysis or
modified nodal analysis [17] circuit equations, as well as 3.3. Example
their Jacobian matrices.
Nine dc operating points of the four-transistor circuit [16]
We used simple models of nonlinear circuits compo-
shown in Figure 1 were found by using our MATLAB im-
nents (diodes and bipolar junction transistors) to demon-
plementation of the homotopy algorithm. Parser was used to
strate the parser correctness. More realistic models could
generate modified nodal analysis equations, and the simple
be implemented by specifying the nonlinear equations that
homotopy function An example of a homotopy is
govern the components’ behavior.
H(x; ) = (1 ; )G(x ; a) + F (x); (12)
3.2. Solver where G is a diagonal scaling matrix, and a is a starting
vector.
There are several approaches to implement homotopy meth- MATLAB can also generate plots of the homotopy paths
ods [2]. We opted for algorithms based on the ordinary dif- for the unknown node voltages and for the currents flowing
ferential equations. through each voltage source. They are shown in Figure 2
The solution of the equation and Figure 4, respectively. By zooming in on the path for
H(x(s); (s)) = 0; (6)
an individual node voltage and current, we can see that each
path crosses the vertical line  = 1 nine times. These paths
are shown in Figures 3 and 5.
where s is the arc length parameter, is a trajectory
The results from MATLAB can be compared with so-
 
(s)
lutions from other homotopy methods [11]. Even though
y(s) = x(s) : (7) Newton-Raphson method solvers like PSPICE and SPICE
3F5 will calculate only one dc operating point, it is possi-
This trajectory is found by solving the differential equation ble to give PSPICE an initial guess that is close to a desired
solution by using the .NODESET option. In this manner,
d by using the MATLAB results as a starting point, we have
ds
H(x(s); (s)) = 0; (8) found all nine dc operating points.
13 Vcc
20

15

R2 10 R11 10

R1 R5 6 T2 5

Node Voltages
4
0
2 8
R13 −5
T1
V1 3
R4 R6 R9 −10
1 0
V2 −15

T3 R7 R10 11 −20

9 0 0.2 0.4 0.6 0.8 1


Lambda
5 R14
7
R8 T4
Figure 2: Homotopy paths for the fourteen node voltages of
12
R3 R12 the four-transistor circuit.

14 Vcc 12

Figure 1: Four-transistor circuit that has nine dc operating 10


points. Circuit parameters: R1 = 1K , R2 = R3 = 4K , R4
= 5K , R5 = R8 = 30K , R6 = R7 = 0.5K , R9 = R10 =
8
10.1K , R11 = R12 = 4K , R13 = R14 = 30K , V1 = 10V,
v (10)

V2 = 2V, and VCC = 12V.


6

4. CONCLUDING REMARKS
4

Our implementation, which employs commercially widely


available software package MATLAB, illustrates that im- 2

plementations of homotopy algorithms need not necessarily 0.98 0.99 1 1.01 1.02 1.03 1.04 1.05
Lambda
rely on large numerical solvers or proprietary circuit simula-
tion tools. Furthermore, simple homotopy functions proved
adequate for solving some difficult benchmark circuits. We Figure 3: Closer view of the homotopy path for the voltage
successfully used the current implementation to find nine at node 10.
dc operating points of a benchmark four-transistor circuit.
The accuracy of the results was verified by comparison with 5. REFERENCES
PSPICE solutions and results of other homotopy implemen-
tations. [1] E. L. Allgower and K. Georg, Numerical Continua-
Our implementation could be made more efficient. It tion Methods: An Introduction. New York: Springer-
takes several minutes to calculate the nine solutions and pro- Verlag Series in Computational Mathematics, 1990,
duce the resulting plot for our example circuit. The speed pp. 1–15.
of the algorithm and the number of solutions found depend
on the starting point of the homotopy path. One possible
[2] L. T. Watson, “Globally convergent homotopy algo-
improvement is to use an algorithm to determine a better
rithms for nonlinear systems of equations,” Nonlinear
starting point, rather than choosing a random value. The al-
Dynamics, vol. 1, pp. 143–191, Feb. 1990.
gorithm could also be improved to eliminate numerical in-
stability for values of  very close to 1 (the so called “end
[3] W. Rheinboldt and J. V. Burkardt, “A locally parame-
game” [19]). Other homotopy mappings could also be im-
terized continuation process,” ACM Transactions on
plemented.
Mathematical Software, vol. 9, no. 2, pp. 215–235,
June 1983.
−3
x 10
0.01 −2

i(VCC1)
0.008 i(VCC2)
i(V1)
0.006 i(V2)

0.004
−2.5

0.002
Currents

i(VCC2)
0

−0.002

−3
−0.004

−0.006

−0.008

−0.01 −3.5
0 0.2 0.4 0.6 0.8 1 0.98 0.99 1 1.01 1.02 1.03 1.04 1.05
Lambda Lambda

Figure 4: Homotopy paths for the four currents flowing Figure 5: Closer view of the homotopy path for the current
through the voltage sources of the four-transistor circuit. flowing through the voltage source connected to node 14.

[4] S. Chow, J. Mallet-Paret, and J. A. Yorke, “Finding ze- [11] K. Yamamura, T. Sekiguchi, and Y. Inoue, “A globally
roes of maps: homotopy methods that are constructive convergent algorithm using the fixed-point homotopy
with probability one,” Mathematics of Computation, for solving modified nodal equations,” Proc. NOLTA
vol. 32, no. 143, pp. 887–899, July 1978. ’96, Kochi, Japan, pp. 463–466, Oct. 1996.

[5] L. T. Watson, S. C. Billups and A. P. Morgan, “Algo- [12] R. Kielkowski, Inside SPICE, Second edition. New
rithm 652: HOMPACK: A suite of codes for globally York, NY: McGraw-Hill, 1998.
convergent homotopy algorithms,” ACM Trans. Math- [13] D. Hanselman and B. Littlefield, Mastering MATLAB:
ematical Software, vol. 13, no. 3, pp. 281–310, Sept. A comprehensive tutorial and reference. Upper Saddle
1987. River, NJ: Prentice Hall, 1996.
[6] L. Goldgeisser and M. M. Green, “A novel algorithm [14] T. L. Quarles, A. R. Newton, D. O. Pederson, and
that finds multiple operating points of nonlinear cir- A. Sangiovanni-Vincentelli, “SPICE 3 Version 3F5
cuits automatically, Proc. ISCAS ’98, Monterey, CA, User’s Manual,” Department of EECS, University of
June 1998, TPA 12-3. California, Berkeley, March 1994.
[7] R. C. Melville, Lj. Trajković, S. C. Fang and L. T. [15] A. Vladimirescu, The SPICE Book. New York: John
Watson, “Artificial parameter homotopy methods for Wiley & Sons, Inc., 1994.
the dc operating point problem,” IEEE Trans. on CAD,
vol. 12, no. 6, pp. 861–877, June 1993. [16] L. O. Chua and A. Ushida, “A switching-parameter al-
gorithm for finding multiple solutions of nonlinear re-
[8] Lj. Trajković and W. Mathis, “Parameter embedding sistive circuits,” Int. J. Circuit Theory Appl., vol. 4, pp.
methods for finding dc operating points: Formulation 215–239, 1976.
and implementation,” Proc. NOLTA ’95, Las Vegas,
[17] C. W. Ho, A. E. Ruehli, and P. A. Brennan, “The modi-
NV, Dec. 1995, pp. 1159–1164.
fied nodal approach to network analysis,” IEEE Trans.
[9] Lj. Trajković, E. Fung, and S. Sanders, “HomSPICE: Circuits Syst., vol. CAS-22, pp. 504–509, Jan. 1975.
Simulator with homotopy algorithms for finding Pa- [18] J. D. Lambert, Numerical methods for ordinary differ-
rameter embedding methods for finding dc and steady- ential equations: The initial value problem. New York,
state solutions of nonlinear circuits,” Proc. ISCAS ’98, NY: John Wiley, 1991.
Monterey, CA, June 1998, TPA 10-2.
[19] M. Sosokina, L. T. Watson, and D. E. Stewart, “Note
[10] D. Wolf and S. Sanders, “Multiparameter homotopy on the end game in homotopy zero curve tracking,”
methods for finding DC operating points of nonlinear ACM Trans. Mathematical Software, vol. 22, no. 3, pp.
circuits,” IEEE Trans. Circuits Syst., vol. 43, pp. 824– 281–287, Sept., 1996.
838, Oct. 1996.

You might also like