0
\$\begingroup\$

Here is a paragraph I came across:

Since transient analysis is dependent on time, it uses different analysis algorithms, control options with different convergence-related issues and different initialization parameters than DC analysis. However, since a transient analysis first performs a DC operating point analysis (unless the UIC option is specified in the .TRAN statement), most of the DC analysis algorithms, control options, and initialization and convergence issues apply to transient analysis.

As far as I know the traditional transient circuit analysis is done by Laplace transform which superpositions both transient solutions and steady state solutions.

But when it comes to SPICE, for high speed calculations it uses different techniques and algorithms to solve circuits which are very alien to me.

I know about Laplace transforms and circuit theory but I'm curious how SPICE solves a circuit(as a big picture)? I'm totally blank about it.

Can the flow of SPICE be explained in an easy manner as a big picture? What is meant by DC operating point analysis and what is UIC ect.? When we run transient analysis what does SPICE do comparing to a traditional circuit analysis on paper?

\$\endgroup\$
17
  • \$\begingroup\$ UIC = Use Initial Conditions. You never calculated the DC operation point or any circuit? \$\endgroup\$
    – G36
    Commented Jun 20, 2017 at 17:58
  • \$\begingroup\$ DC operating point analysis = solve for DC voltage/current in the circuit when all capacitors are treated as a open circuit and inductors as a short circuit. \$\endgroup\$
    – G36
    Commented Jun 20, 2017 at 18:00
  • \$\begingroup\$ I did for transistor circuits when finding load lines that was it. \$\endgroup\$
    – user1245
    Commented Jun 20, 2017 at 18:01
  • \$\begingroup\$ Transient analysis divided into how many parts in SPICE? I mean it solves DC and then do Laplace transforms? \$\endgroup\$
    – user1245
    Commented Jun 20, 2017 at 18:05
  • 1
    \$\begingroup\$ You can set the initial voltage on the capacitor to anything you want. In LTSpice, Ctrl-rightclick on the capacitor and change the 'SpiceLine' attribute to "IC=<value>", and when you use UIC in the simulation card, the capacitor will get the initial voltage you specified. It should also work for inductor initial current. \$\endgroup\$
    – The Photon
    Commented Jun 21, 2017 at 0:41

2 Answers 2

2
\$\begingroup\$

In an answer to an old question I gave a run-down of the three main analysis types done by SPICE and SPICE-like simulators.

As far as I know the traditional transient circuit analysis is done by Laplace transform which superpositions both transient solutions and steady state solutions.

This is incorrect. SPICE typically does transient analysis using a time domain integration method, such as Runge-Kutta or Gear's method.

Where a transient simulation is solving a system of ordinary differential equations, DC analysis is solving a system of nonlinear algebraic equations. A simple method for this Newton's method, although a good SPICE will generally use something more robust.

Some simulators (ADS, for example) will let you choose different solution methods in case one method is quicker or more robust for a certain circuit.

Edit

In comments you asked,

My main question is SPICE dealing with DC operating point as a part of transient analysis?

This is answered in the quote you posted:

a transient analysis first performs a DC operating point analysis

This means that when you request a transient analysis (unless you use a .UIC directive, as pointed out in comments), the simulator first does a DC analysis, and uses the result of this as the starting state for the time domain analysis.

Whether this is "part of a transient analysis" or a separate step that isn't "part of" the transient analysis is a semantic question and you could view it however you like.

Note: If you request both DC analysis and TRAN analysis, most SPICE's are smart enough to not do the DC analysis twice. Does this mean the DC analysis is not "part of" the transient analysis? Again, it's really up to you how you want to look at it.

\$\endgroup\$
4
  • \$\begingroup\$ My main question: is SPICE dealing with DC operating point as a part of transient analysis? Consider for example a passive LCR circuit. Because we don't do "DC op. point." thing when solving with Laplace transform \$\endgroup\$
    – user1245
    Commented Jun 20, 2017 at 18:55
  • \$\begingroup\$ @user134429 Spice typically has at least two choices in answer to your question here (I'm adding an answer of my own to provide a different perspective): you can request that Spice does NOT do a DC operating point analysis first, or else you can allow it to do that. Most of the time, people let it do the DC operating point analysis as a first step. But you can block it, if you want. You can also set initial conditions for any of the independent state variables. \$\endgroup\$
    – jonk
    Commented Jun 20, 2017 at 19:05
  • \$\begingroup\$ Can you give an example and solve a simple RC circuit as if you are a SPICE program? Would that be too much effort? If so forget about it. \$\endgroup\$
    – user1245
    Commented Jun 20, 2017 at 19:06
  • 1
    \$\begingroup\$ @user134429 Sure. I could do that. However, it will have to wait as I have plenty of work I have to attend to right now. I'll consider adding a specific example, with details as actually used by Spice, to my answer. But it will be at least another 8 hours before I can take the time. \$\endgroup\$
    – jonk
    Commented Jun 20, 2017 at 19:17
2
\$\begingroup\$

The subject of how Spice handles all the different analysis requests would fill a book. In fact, it fills books! There is no possible way to cover all of that here. (Nor can I pretend that I completely understand all of practical details involved.) However, I can consider the idea of addressing transient analysis, since I do understand that part of Spice better.

First off, I'd recommend that you purchase a copy of Laurence W. Nagel's (who is, to all intents and purposes the "father" of Spice) "Spice2: A Computer Program to Simulate Semiconductor Circuits," Memorandum No. UCB/ERL M520, 9 May 1975, which is available from "Electronics Research Laboratory, College of Engineering, University of California, Berkeley, CA 94720. (The title is slightly misspelled on the document you'll get, saying "Semicoductor" instead of "Semiconductor", but oh well.) This is the seminal and definitive document on Spice's operations. If you want the details, it's all there.

But the overview for transient analysis is something like this: Ideal branch relations are developed, constrained by explicit and implied Kirchoff laws. Then, cutset and loop analysis is applied. (Which, by the way, place limitations on the types of branch relations that can even be included in the circuit. So there are some kinds of equivalent replacements that take place about this time.) For formulating, a modified form of Nodal Analysis, or hybrid analysis (state variable analysis, for example), or the sparse tableau method (all variables in a huge vector and a very, very sparse system of circuit equations) are used.

In the end, numerical methods are also required of course. Some of the details also involve different numerical methods to solve, once all the formulation is complete. Many Spice programs include multiple approaches to numerical solutions. There are various problems that arise here, as the problem is basically very much like an infinite plane with all kinds of local minima and maxima and a very, very difficult time locating and finding the global maximum or minimum across that entire plane. Spice may get "trapped" into a local high/low point and not be able to find its way out of there. So there are other techniques which can help either recognize these issues and apply "tests" to see if it needs to widen the scope (source-stepping methods) or else start up multiple solutions and see which of them find the right global result (simulated annealing.)

A lot has happened over time and not all Spice simulators use all of the exact same tools and/or all in the same way, all of the time. This is one of the reasons that professionals may include several different implementations of Spice in their toolchest or, in the case of IC manufacturers, will have programmers on staff who continue to develop and modify Spice so that it handles cases they care about well.

But seriously, if you are really interested in understanding exact details (including examples provided), then I'd recommend that memorandum I mentioned above. It's not terribly expensive and it is, far and away, the best source for explicit details about how Spice works (with references for still more details, if needed.)

\$\endgroup\$
10
  • \$\begingroup\$ Did you really read the entire book? Its around 400 pages. Here is the book you mentioned:www2.eecs.berkeley.edu/Pubs/TechRpts/1975/ERL-520.pdf Please see page 9. At page 9 DC operating point is not part of transient analysis. It is part of only DC Analysis. But in another source it says: "However, since a transient analysis first performs a DC operating point analysis" Do you get my confusion? \$\endgroup\$
    – user1245
    Commented Jun 20, 2017 at 19:22
  • \$\begingroup\$ @user, look at page 16: "The initial timepoint, arbitrarily defined as time zero, is determined by a previous dc operating point solution". \$\endgroup\$
    – The Photon
    Commented Jun 20, 2017 at 19:47
  • \$\begingroup\$ @jonk, Are you sure about your statement that "loop analysis is applied."? I've always learned that SPICE uses MNA (modified nodal analysis) and according to your source, "the MNA1 formulation method presently is implemented in SPICE2" [p. 85] \$\endgroup\$
    – The Photon
    Commented Jun 20, 2017 at 20:08
  • \$\begingroup\$ @ThePhoton They mention MNA1 and MNA2 and this is all dated back to 1975, when the doc was written. Anything I write will be "dated" in that sense. However, the document includes worked examples. The OP can draw from those examples. (I have some personal email with Mike, who writes Linear's Spice, and I may refer back to that.) \$\endgroup\$
    – jonk
    Commented Jun 20, 2017 at 20:17
  • \$\begingroup\$ @user134429 Good catch on the PDF being available. I didn't know it was present at that link. THANKS!!! I guess I don't need to write anything at all now! Heck. Now I can just delete my answer and move your link to a comment to your question. ;) I'm really happy to see it publicly available now. \$\endgroup\$
    – jonk
    Commented Jun 20, 2017 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.