*Posted by Colin Warwick*

In part one, we just covered DC analysis of conductances and current sources. What about other analyses and components?

### Voltage Sources and Other Infinite Conductances

It turns out that pure nodal analysis can’t handle voltages sources because they have infinite conductance. So the answer to puzzle event #3 is *voltages sources*. (Larry Nagel pointed out in a comment there that non-linear resistor is also a right answer *if* its current is not a well behaved function of its voltage. So give yourself credit that was your answer *and* you knew the bit about the current not being a well behaved function of its voltage. 🙂 )

SPICE avoids the infinite conductance problem by modified nodal analysis (MNA). Nodes joined by infinite conductances are considered "super-nodes" whose constituent node voltages V_{x} and V_{y} move up and down in lock step. When SPICE creates a super-node the two individual KCL equations are eliminated and replaced by one KCL equation that sums all the currents into both nodes (into the blue dashed oval in the figure above) plus one internal constitutive equation, namely V_{x} = V_{y} + V_{xy}, where V_{xy} is the known value of the voltage source. Shorts and current sinks (i.e. the input ports of current controlled sources) can be treated similarly.

(MNA isn’t the only solution to the infinite conductance problem. For example Hachtel et al. proposed a sparse tableau method of where both branch currents and node voltages are considered unknown, both KCL and KVL equations are formulated. You then have to pick out a set of linearly independent equations.)

### Three and Four Terminal Devices

How about more than two terminals? It turns out that when the current source "stamped" its pattern-of-four into the conductance matrix, it was a special case of a more general four terminal "stamp." The general case is the *trans*conductance:

The “pattern of four” is simply displaced off-diagonal in the conductance matrix.

Column a | Column b | Column x | Column y | |

Row a | +G_{m} | −G_{m} | ||

Row b | −G_{m} | +G_{m} | ||

Row x | ||||

Row y |

### Non-linear, Time-domain (“Transient”) Analysis

For transient analysis, components are represented in differential or integral form. See the table below. SPICE performs numerical ordinary differential equation (ODE) solution. Non-linear elements are solved by an iterative method (e.g. Newton-Raphson) at each time step. An initial guess at the node voltages is created (usually all zeros). The slope and intercept of the tangent to the actual I-V curve is used to calculate a linear approximation of the non-linear element. The linear approximation (a conductance and a current source) is inserted into the conductance matrix as a proxy for the real device. Solution of the linear proxy yields better guess at the voltage vector. A new set of conductance/current source proxies is calculated using tangents at the new voltages. This is repeated until — hopefully! — convergence is reached for that time step.

SPICE uses variable time steps. The initial voltage vector guess for each time step is the converged solution of the previous step. If the time step causes accuracy problems, SPICE backtracks by disregarding that calculation and taking a small step from the previous time point.

### AC Analysis

For DC analysis, reactive elements — inductors and capacitors — are treated as shorts and opens, respectively. For AC analysis, complex admittance is used in place of real conductance. For example admittance of a capacitor and inductor are jωC and 1/jωL, respectively. Again see the table below.

### Table of branch constitutive equations for various components and various analyses in SPICE

Here’s a link to the web page for the SPICE descendant in Agilent ADS: W2302 Transient Convolution Element

For more information about SPICE including a bibliography, please see the SPICE page on Wikipedia.

Please give feedback on this article by leaving a comment below.

Circuit Simulation - Part One - SPICE Turns Thirty-Six// Apr 20, 2009 at 7:54 pm[…] Circuit Simulation – Part Two – How Various Components and Analyses Are Handled […]

Puzzle Event 3 - Nodal Circuit Simulator// May 4, 2009 at 10:17 am[…] Circuit Simulation – Part Two – How Various Components and Analyses Are Handled […]

Puzzle Event 3 – Nodal Circuit Simulator// Sep 15, 2009 at 4:42 pm[…] OK A few days are up. Here’s the answer at Circuit Simulation Part Two – How Various Components and Analyses are Handled […]

Circuit Simulation – Part One – SPICE Turns Thirty-Six// Jan 25, 2010 at 10:14 pm[…] for a future posting on how SPICE deals with time-stepping (‘transient analysis’), with reactive, […]