Electronics-Related.com
Forums

Simulating Power Bandwidth

Started by Jim Thompson May 24, 2014
In article <lm5dtg$o13$1@dont-email.me>, Tim Williams
<tmoranwms@charter.net> wrote:

> "RobertMacy" <robert.a.macy@gmail.com> wrote in message > news:op.xgksy1ym2cx0wh@ajm... > > Exactly where is a good description for all these options? > > ...Let alone how to use them? > > Stuff like GEAR is well documented by most SPICE descriptions, and > computational solvers in general; it's their word for Runge-Kutta of order > MAXORD. Note that TRAP (trapezoidal, i.e. Newton's Method, more or less) > is essentially RK1.
For even more information, consult books on numerical methods, especially numerical solution of differential equations. Also books on linear algebra, especially numerical methods.
> I very rarely use TRAP in my simulations because the settling is poor and > erratic (the result is a distinctive alternation, every other timestep, of > a given variable about its ideal value -- it looks like triangles when > zoomed), particularly for nonlinear (switching) circuits. Occasionally, I > find RK4 (GEAR, MAXORD = 4) beneficial: the average timestep is calculated > much more slowly (more derivatives to compute), but the worst-cases are > much better -- it's not digging as deep (constantly redoing a bad > calculation at progressively smaller timesteps) or as often, around > strongly nonlinear events (such as switching edges), so the overall > simulation can run faster (and more stable -- less likely to get stuck on > a randomly too-small timestep). > > I don't believe I've ever seen GEAR2 produce "bobbling" results; either it > settles asyptotically, or the oscillation is really there (as evidenced by > finding a smooth sinusoidal oscillation after setting smaller RELTOL > and/or max. timestep to enhance detail). > > As for "how to use", judging by the dearth of instructions or even useful > documentation on most SPICE settings, I can only assume three things: > > 1. Don't touch that, you'll screw it up! Use the default settings! If it > starts throwing errors, the circuit /must/ be impossible! > 2. Play with all of them and see what works. Life is a journey, or > something. > 3. I know what works, but I'm not going to tell you. > > Against the apparent collective wisdom of all three, I dare suggest these, > which seem to work well enough (these are in Multisim, which is your basic > XSPICE backend): > http://seventransistorlabs.com/Images/SimSettings1.png > http://seventransistorlabs.com/Images/SimSettings2.png > http://seventransistorlabs.com/Images/SimSettings3.png > but not all are available in LTSpice, so YMMV. > > The most obscure setting of them all seems to be pivot (PIVREL, PIVTOL). > It's purely a computational thing, and of the few references I can find to > it, the only sentiment is "does nothing, leave it alone". Yet I've had > more than a few failing circuits fixed by setting a more strict (larger) > value, like as shown. I dare someone to explain that.
They are most likely talking about pivoting, which is done in the solution of linear equations by gaussian elimination. Spice solves a linear equation at each time step. If these are really absolute and relative tolerances (as the names would suggest), I doubt that larger values are more strict. Making these tolerances larger makes the algorithm less fussy. Anyway, it's a long story, but the system matrixes that describe circuitry are quite nonlinear (all those semiconductors!) and are often ill-conditioned (and thus very sensitive to tiny errors). A lot of this is in Nagel's PhD thesis, the founding document of SPICE, although SPICE has evolved considerably since then. ..<http://en.wikipedia.org/wiki/SPICE> Joe Gwinn
"Joe Gwinn" <joegwinn@comcast.net> wrote in message 
news:310520142232300925%joegwinn@comcast.net...
>> The most obscure setting of them all seems to be pivot (PIVREL, >> PIVTOL). >> It's purely a computational thing, and of the few references I can find >> to >> it, the only sentiment is "does nothing, leave it alone". Yet I've had >> more than a few failing circuits fixed by setting a more strict >> (larger) >> value, like as shown. I dare someone to explain that. > > They are most likely talking about pivoting, which is done in the > solution of linear equations by gaussian elimination. Spice solves a > linear equation at each time step. > > If these are really absolute and relative tolerances (as the names > would suggest), I doubt that larger values are more strict. Making > these tolerances larger makes the algorithm less fussy.
Oops, I probably had "less strict" or "more relaxed" in my mind when typing that. Or, you know how it is when talking about loading with resistance (a reciprocal quantity). :)
> Anyway, it's a long story, but the system matrixes that describe > circuitry are quite nonlinear (all those semiconductors!) and are often > ill-conditioned (and thus very sensitive to tiny errors). A lot of > this is in Nagel's PhD thesis, the founding document of SPICE, although > SPICE has evolved considerably since then. > > ..<http://en.wikipedia.org/wiki/SPICE>
If it has evolved significantly, then why haven't partial-matrix tiumestepping methods and such trickled down to our level yet? :) My understanding of the average commercial offering is, they either start with 3f5, which was the last and most useful Berkeley version, or XSpice, which includes digital models and a couple more convergence hacks (I think it introduced Gmin stepping..?). And apply their own proprietary mods from there (PSpice with more functions and weird syntax; HSpice with even more, and some more convergence I think, and those fucking encrypted models; LTSpice with multithreading, also encrypted models; etc.), with a graphical schematic capture and graphing and postprocessor tossed in front. And ALL the low to mid level software (OrCAD, Altium, etc.) resides at this level and there is simply no core development or competition beyond that level. Which it seems to me, if it weren't for the grace of academia having written SPICE for free, these companies wouldn't give less than two shits abuut putting simulation in their products at all! Tim -- Seven Transistor Labs Electrical Engineering Consultation Website: http://seventransistorlabs.com
In article <lme829$n5r$1@dont-email.me>, Tim Williams
<tmoranwms@charter.net> wrote:

> "Joe Gwinn" <joegwinn@comcast.net> wrote in message > news:310520142232300925%joegwinn@comcast.net... > >> The most obscure setting of them all seems to be pivot (PIVREL, > >> PIVTOL). > >> It's purely a computational thing, and of the few references I can find > >> to > >> it, the only sentiment is "does nothing, leave it alone". Yet I've had > >> more than a few failing circuits fixed by setting a more strict > >> (larger) > >> value, like as shown. I dare someone to explain that. > > > > They are most likely talking about pivoting, which is done in the > > solution of linear equations by gaussian elimination. Spice solves a > > linear equation at each time step. > > > > If these are really absolute and relative tolerances (as the names > > would suggest), I doubt that larger values are more strict. Making > > these tolerances larger makes the algorithm less fussy. > > Oops, I probably had "less strict" or "more relaxed" in my mind when > typing that. Or, you know how it is when talking about loading with > resistance (a reciprocal quantity). :) > > > Anyway, it's a long story, but the system matrixes that describe > > circuitry are quite nonlinear (all those semiconductors!) and are often > > ill-conditioned (and thus very sensitive to tiny errors). A lot of > > this is in Nagel's PhD thesis, the founding document of SPICE, although > > SPICE has evolved considerably since then. > > > > ..<http://en.wikipedia.org/wiki/SPICE> > > If it has evolved significantly, then why haven't partial-matrix > timestepping methods and such trickled down to our level yet? :)
I haven't followed the internals of SPICE since I read Nagel's thesis, but I'd hazard a guess that it's too much work to be done for the income stream one gets.
> My understanding of the average commercial offering is, they either start > with 3f5, which was the last and most useful Berkeley version, or XSpice, > which includes digital models and a couple more convergence hacks (I think > it introduced Gmin stepping..?). And apply their own proprietary mods > from there (PSpice with more functions and weird syntax; HSpice with even > more, and some more convergence I think, and those fucking encrypted > models; LTSpice with multithreading, also encrypted models; etc.), with a > graphical schematic capture and graphing and postprocessor tossed in > front. And ALL the low to mid level software (OrCAD, Altium, etc.) > resides at this level and there is simply no core development or > competition beyond that level. Which it seems to me, if it weren't for > the grace of academia having written SPICE for free, these companies > wouldn't give less than two shits abuut putting simulation in their > products at all!
Somebody would have invented SPICE if Nagel had not, because the time was ripe - both the means (computers) and the need (IC design) had arrived. But you are right - widespread use of SPICE has forced manufacturers to provide at least checkbox support. But this kind of mathematical software isn't cheap to maintain and upgrade, and especially to provide models for. The operating-system equivalent to component models is I/O drivers. Joe Gwinn
"Joe Gwinn" <joegwinn@comcast.net> wrote in message 
news:010620141342206648%joegwinn@comcast.net...
> But this kind of mathematical software isn't cheap to maintain and > upgrade, and especially to provide models for. The operating-system > equivalent to component models is I/O drivers.
Well, now you're not doing yourself any favors. Windows comes with tens of thousands of drivers, and only costs a hundred bucks! (c; Tim -- Seven Transistor Labs Electrical Engineering Consultation Website: http://seventransistorlabs.com
In article <lmgtk8$8su$1@dont-email.me>, Tim Williams
<tmoranwms@charter.net> wrote:

> "Joe Gwinn" <joegwinn@comcast.net> wrote in message > news:010620141342206648%joegwinn@comcast.net... > > But this kind of mathematical software isn't cheap to maintain and > > upgrade, and especially to provide models for. The operating-system > > equivalent to component models is I/O drivers. > > Well, now you're not doing yourself any favors. Windows comes with tens > of thousands of drivers, and only costs a hundred bucks! (c;
Huh? Too much context is gone, and I don't recall what I was reacting to. Joe Gwinn