Exploring the Internal Workings of SPICE Simulators

  • Thread starter jbusc
  • Start date
  • Tags
    Internal
In summary, spice models transistors by reading off the input file and stamping a constitutive relation into a matrix connecting the nodes that the device is connected to. It then uses a numerical technique to solve for all of the node voltages.
  • #1
jbusc
211
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
  • #2
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
 
  • #3
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. :)
 
  • #4
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.
 
  • #5
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?
 
  • #6
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" [Broken]
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:
  • #7
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.
 

1. What is a SPICE simulator and how does it work?

A SPICE (Simulation Program with Integrated Circuit Emphasis) simulator is a computer program used to simulate and analyze the behavior of electronic circuits. It works by solving a set of mathematical equations that represent the circuit's behavior using circuit components, such as resistors, capacitors, and transistors.

2. What are the benefits of using SPICE simulators?

SPICE simulators allow engineers and scientists to test and analyze electronic circuits without the need for physical prototypes, saving time and money. They also provide detailed insights into the internal workings of a circuit, allowing for optimization and troubleshooting.

3. Are there different types of SPICE simulators?

Yes, there are various types of SPICE simulators available, each with its own unique features and capabilities. Some popular ones include LTspice, PSpice, and HSPICE.

4. Can SPICE simulators accurately predict the behavior of real circuits?

While SPICE simulators can provide close approximations of circuit behavior, they may not always be 100% accurate. Factors such as component tolerances and parasitic effects can affect the simulation results. It is important to validate the simulation results with physical testing.

5. How can I learn to use SPICE simulators?

There are many resources available for learning how to use SPICE simulators, including online tutorials, user manuals, and community forums. It is also helpful to have a basic understanding of circuit theory and programming languages such as SPICE netlists or Verilog-A, which are used to describe the circuit to the simulator.

Similar threads

Replies
4
Views
609
  • Electrical Engineering
Replies
26
Views
2K
  • Electrical Engineering
Replies
10
Views
2K
  • Electrical Engineering
Replies
4
Views
4K
  • Electrical Engineering
Replies
1
Views
5K
Replies
4
Views
2K
  • Electrical Engineering
Replies
13
Views
1K
Replies
4
Views
405
  • Electrical Engineering
Replies
5
Views
2K
Replies
9
Views
561
Back
Top