eCircuit Center 
SPICE Topics 
About SPICE 
SPICE Basics  Running SPICE
 CIRCUIT COLLECTION 
SPICE Commands  SPICE Demos and Downloads 

SPICE ALGORITHM OVERVIEW Regardless if you have a great or small interest in understanding how SPICE works, its a good idea to get a basic grasp of it. Why? For the same reason it helps to have basic understanding of how your car works  when things go wrong. The same holds true with SPICE. Sooner or later, your simulation grinds to halt and you'll need to peer under the hood and start tinkering to get it going again. There's another reason to see the big picture. Not only to satisfy your curiosity, but to get an appreciation of this marvelous tool.
BLOCK DIAGRAM Here's a simplified block diagram of the main SPICE program flow. Most of SPICE's amazing capabilities (and problems) happen right here! Here's three key points about the algorithm:
ALGORITHM IN ACTION In a nutshell, SPICE can do the following:
Based on these main muscles, SPICE also serves up some extended analysis like sensitivity, Fourier, noise, etc. But, lets take a look at some of the main analysis and see which parts of the algorithm are called into action to perform them. DC ANALYSIS DC Analysis is performed either to calculate a DC Operating Point or a DC Sweep. An operating point is required for the initial solution to a Transient Analysis or as a bias point for an AC Analysis. The DC Sweep does exactly as the name implies  performs the DC Analysis multiple times as you sweep a selected component parameter across a defined range. All energystorage components like capacitors, inductors and semiconductor charge mechanisms are ignored for this analysis! One of the simpler tasks for SPICE is performing DC Analysis on Linear circuits. Only two of the blocks are really needed: Load the Nodal Matrix (3) and solve the Nodal Equations (4) using Gaussian Elimination. (See Nodal Analysis.) One important point  Nodal Analysis works for a system of linear equations. For NonLinear circuits SPICE needs to create equivalent linear models for the nonlinear devices! But, it can only guess at the operating point for which the models are created. The loop (blocks 16) iteratively finds the exact solution as follows: guess an operating point, create equivalent linear models and solve the Nodal Matrix for the circuit voltages. Then, choose a new operating point based on the new voltages and start all over again. How does SPICE know when to stop? When the changes in circuit voltages and currents have fallen below some limit, from one iteration to the next, the solution is said to have converged! (See NonLinear Analysis.) This is known as the RaphsonNewton solution of nonlinear circuits. TRANSIENT ANALYSIS To perform a Transient Analysis for Linear Circuits, SPICE completes the outer loop only, ignoring blocks 2 and 5. After the initial operating point is found, the energystorage components (capacitors, inductors, semiconductor junctions) are transformed into linear companion models, well suited for the Nodal Equation solver. (See Transient Analysis.). For NonLinear Circuits, SPICE completes the NonLinear loop (26) at each time point of the Transient Analysis. SPICE dynamically adjusts the time step, h(n). Why? For two reasons  to improve accuracy and reduce long simulation times. The time step will be reduced when circuit voltages and currents are changing rapidly. Under these conditions, accuracy generally improves with a smaller time step. On the other hand, if nothing much is happening dynamically in a circuit, increase the time step to avoid a painfully long simulation. AC ANALYSIS The AC Analysis happens in two parts.
SPICE CONTROL Although most SPICE simulations runs smoothly, sometimes the program sputters to a halt. What would cause it to stop? Just a pick a block in the diagram and you've got a potential problem. That's one of the reasons why there are so many Options available for running a SPICE simulation. For example, options adjust parameters such as:
The good news is that users are given reasonable control over the simulation. Sometimes the simple tweeking of an option can get your simulation going again. The bad news is the number of options and correctly adjusting them. In later topics covering options, SPICE troubles, and convergence (or nonconvergence), we'll refer back to the block diagram above. NEED MORE INFO? Here are some great sources of information about the SPICE engine.
For more info on these and other books go to the Bookshop.

About SPICE 
SPICE Basics  Running SPICE
 CIRCUIT COLLECTION 
SPICE Commands 