How Do SPICE Simulators Perform Their Calculations Internally?

  • Thread starter Thread starter jbusc
  • Start date Start date
  • Tags Tags
    Internal
AI Thread Summary
SPICE simulators perform calculations by reading input elements and creating a matrix that connects the nodes of the circuit. They utilize modified nodal analysis to set up a system of equations, incorporating linear and nonlinear elements through Jacobian stamping. For linear systems, they typically apply LU decomposition or iterative methods, while dynamical systems are solved using the trapezoidal rule. Nonlinear systems are addressed with Newton's method to generate linearized versions for solving. Understanding these internal processes reveals the complexity behind SPICE's functionality, despite its conceptual simplicity.
jbusc
Messages
210
Reaction score
0
Are there any good sources anywhere for detailed info on how SPICE simulators work internally? I'm interested in learning more about how spice actually goes about its calculations, thanks.
 
Engineering news on Phys.org
Are you interesting in how it models a transistor or how sets up and solves a system of equations? Pretty much any answer will be specific to a particular version of spice but for the transistor:
In general this model is used:
http://en.wikipedia.org/wiki/Bipolar_junction_transistor#Ebers.E2.80.93Moll_model
If you can specify more parameters then often this one is used:
http://eesof.tm.agilent.com/docs/ic...MODELING/3TRANSISTORS/1GummelPoon/GP_DOCU.pdf

This link seems effective but to be honest I only glanced through it:
http://en.wikipedia.org/wiki/SPICE
 
Oh ya, I supose that answer is only good for bipolar transistors. Not sure sure if there is a generic FET model. I kinda doubt it. The version I use is hspice.
http://www.stanford.edu/class/ee133/spice/hspiceman.pdf
There is a chapter that describe the various FET models in excruciating detail if you are really interested. I have never been that interested myself and only use it for reference when necessary. :)
 
It uses modified nodal analysis to set up a system of equations, and then uses Newton's method combined with the trapezoidal rule to step through time.
 
I'm fairly familiar with spice input, that is, the measured parameters which define the electrical behavior of the transistor or other devices.

What I want to know is more about the details of how it actually goes about using those parameters. Like, I know it uses the modified nodal analysis, but it's surely more complex than that internally, right?
 
jbusc said:
What I want to know is more about the details of how it actually goes about using those parameters. Like, I know it uses the modified nodal analysis, but it's surely more complex than that internally, right?

It's really not that complicated. It reads each element off the input file, and then stamps a constitutive relation into a matrix connecting the nodes that the device is connected to.
http://ocw.mit.edu/NR/rdonlyres/Electrical-Engineering-and-Computer-Science/6-336JFall2003/DDF74FDE-003D-42C6-AE1F-09E39CC48A0C/0/lec2.pdf"
Have a look at slides 19-32 specifically and it shows you how to turn a resistor network with sources into a linear system. If you have capacitors or inductors, it does the same thing by adding a C and an L matrix and time derivatives to get a dynamical linear system. It gets a little bit trickier when you include nonlinear elements because then it needs to know the Jacobian (change in current with respect to change in voltage at each node it's connected to) of each element and it stamps those into a linearized system.

Once it has the system assembled, it uses your standard numerical technique to solve for all of the node voltages. If the system is linear, it just solves it with LU decomposition or an iterative scheme. If the system is dynamical, it uses the trapezoidal rule (I think) to itegrate through time. If the system is nonlinear, it just uses Newton's method to create a bunch of linearized versions of the system and solves those.
 
Last edited by a moderator:
hmm, I see. I guess it's conceptually pretty simple then, but it makes me wonder why I had trouble finding info on the web about the exact details. thanks.
 

Similar threads

Replies
1
Views
3K
Replies
26
Views
3K
Replies
15
Views
6K
Replies
1
Views
5K
Replies
3
Views
2K
Replies
20
Views
32K
Back
Top