I12
1 G01 1 G20 2 2G01 2G20 V0
2G01 1 G12 1 G01 2 2G12 V1
+ 2G20 2G12 1 G20 1 G12 2 V2
V1 V2
G12 I20 2 I01
5 I01 2 I12
I12 2 I20
+
G01 G20
I01 I20
Note the pattern of four that each conductance (e.g. G01 high-
+ lighted below) impresses into the conductance matrix (Table 1).
In SPICE parlance, making this pattern of four im-
pression is called stamping the matrix. Conveniently, this
V0 stamping generaliz-
es for any number of
Fig. 1. Table 1.
nodes and two termi-
Column x Column y
nal components. In a
1
For example Computer Methods for Circuit Analysis and Design by future article, well Row x 1Gxy 2Gxy
Kishore Singhal and Jiri Vlach show how a small Row y 2Gxy 1Gxy
2
The ch in Kirchhoff is pronounced like the ch in the Scots word lo ch. modification to this
2009 IEEE 59
I12
lax
+
V1 V2 lcx lbx
G12
Node x
+
I01 G01 G20
I20
+
+ Vxy
V0 Vx
60 2009 IEEE
Non-linear, Time-domain
Table 3. branch constitutive equations (Transient) Analysis
for various components and various For transient analysis, components are represented in differen-
analyses in SPICE
tial or integral form. See the table below. SPICE performs a
Element Mode Branch constitutive equation numerical ordinary differential equation (ODE) solution.
Non-linear elements are solved by an iterative method (e.g.
Resistor G 5 1/R All I 5 GV
Newton-Raphson) at each time step. An initial guess at the
Capacitor C DC V 5 ?, I 5 0 node voltages is created (usually all zeros). The slope and
dV intercept of the tangent to the actual I-V curve is used to
Transient I5C
dt calculate a linear approximation of the non-linear element.
The linear approximation (a conductance and a current source)
AC I 5 jvCV is inserted into the conductance matrix as a proxy for the real
Inductor L DC V 5 0, I 5 ? device. The solution of the linear proxy yields a better guess
1 at the voltage vector. A new set of conductance/current source
Transient I5 e Vdt
L proxies is calculated using tangents at the new voltages. This
is repeated until hopefully! convergence is reached for
AC V
I5 that time step.
jvL SPICE uses variable time steps. The initial voltage vector
Voltage Source All V 5 V, I 5 ? guess for each time step is the converged solution of the pre-
Current Source All V 5 ?, I 5 l5 vious step. If the time step causes accuracy problems, SPICE
backtracks by disregarding that calculation and taking a small
Voltage All Vout 5 ?, Iout 5 gmVin
step from the previous time point.
Controlled
Current Source
Voltage All Iout 5 ?, Vout 5 AVin AC Analysis
Controlled For DC analysis, reactive elements inductors and capacitors
Voltage Source are treated as shorts and opens, respectively. For AC analysis,
Current All Vout 5 ?, Iout 5 AIin complex admittance is used in place of real conductance. For
Controlled example, admittance of a capacitor and inductor are jvC and
Current Source 1/jvL, respectively. Again see Table 3 at left.
Current All Iout 5 ?, Vout 5 Iin Rm SPICE has its limitations. If there is a changing magnetic
Controlled flux through a given mesh, Faradays Law of magnetic induc-
Voltage Source tion = 3 E 5 2B. affects the branch equations and breaks
KVL by making the electric field non-conservative and the
Mutual DC V1 5 V2 5 0, I 5 ? voltage undefined. At that point you need to switch to an EM
Inductor M
solver, which is a topic for another day.
1 1
Transient I1 5
L11
e V1dt 1 M e V2 dt Colin Warwick is signal integrity product
1 1
manager at the EEsof division of Agilent Tech
I2 5 e V2dt 1 M e V1 dt nologies. Prior to joining Agilent, Colin was
L22
with Royal Signals and Radar Establishment in
V1 V2 Malvern, England, then Bell Labs in Holmdel,
AC I1 5 1
jvL11 jvM NJ, and most recently at The MathWorks in
V2 V1
Natick, MA. He completed his bachelor, masters,
I2 5 1 and doctorate degrees at the University of Oxford,
jvL22 jvM
England. He has published over 50 technical
articles and holds thirteen patents. EMC
2009 IEEE 61