convergence


To ng-spice-devel@ieee.ing.uniroma1.it
From Al Davis <aldavis@ieee.org>
Date Thu, 26 Apr 2001 10:53:00 -0700
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <CF654D964573D311A1CA0090278A36FF4CBE4C@EDIN_EXM1 >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
References <CF654D964573D311A1CA0090278A36FF4CBE4C@EDIN_EXM1 >
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

(nothing to do with CVS...)

Can someone explain the Spice convergence checking to me?
I find it confusing (or lame).

It looks to me like it is:

1. All node voltages are checked against the previous iteration, as 
per reltol, abstol, etc.

tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol;
if (fabs(new-old) >tol ) {
   // it fails
}

2. If device limiting occurs, it fails.

3. That's all!!

It appears to me that state variables are not checked individually.  
The primary check is for node voltage.


In addition, a device could be bypassed:

If a the node voltages, total current, and stray diode currents of a 
particular device meet convergence criteria, it can be bypassed.



ACS convergence checking is strictly at the device level.

More specifically, it is usually at the primitive level, in 
ELEMENT::tr_eval().  Most primitives compute some kind of y=f(x), 
then convert it to a form suitable for stamping into the matrix.  In 
the simple case, there are 3 checks on each: the input (x), the 
output (y), and the derivative (dy/dx).  If any fail, it is rejected.

For poly primitives (multiple inputs), all derivatives are checked.

A device like a MOSFET is made of a collection of primitives:

3 nonlinear capacitors.
2 diodes (each comprised of a nonlinear conductance and nonlinear cap)
2 fixed resistors
1 poly-conductance
1 poly-capacitance (sometimes)

So, when all is combined, the following parameters are checked 
individually:

All 6 internal voltage pairs (vgs, vgd, vgb, vdb, vsb, vds)
currents: id(channel only), 2 diodes(without charge part)
derivatives of currents (2 diodes, gds, gmb, gm)
charges: (2 diodes, 3 Meyer caps, possibly BSIM nqs)
derivatives of charges

Since it is all done at the primitive level, the mosfet code actually 
contains no convergence checking at all.

A device can be bypassed if the previous iteration was accepted and 
vgs, vbs, vds still meet criteria.  If a group of devices is 
bypassed, portions of the matrix solution may also be bypassed.  


I have seen examples where ACS fails to converge and Spice 
"converges" to a nonsense result.

Partial thread listing: