Re: [ng-spice-devel] TRtol setting. Speed vs. accuracy


To ng-spice-devel@ieee.ing.uniroma1.it
From Steve Hamm <Steve.Hamm@motorola.com>
Date Mon, 27 Aug 2001 09:33:55 -0500 (CDT)
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <PBEHIGMLDPFPLAANAKMPMELBCBAA.jon@beigebag.com >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
References <01050114374903.26584@hobbes ><PBEHIGMLDPFPLAANAKMPMELBCBAA.jon@beigebag.com >
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

---"Jon" == Jon Engelbert <jon@beigebag.com> writes:

Jon> As you can see, TSKtrtol has been changed from 7 to 1, which
Jon> later gets passed to ckt->CKTtrtol, which is used in CKTterr
Jon> which is in turn used to determine truncation errors for many of
Jon> the device types.  In practice, this results in the transient
Jon> taking a lot longer to settle on each "next" time.

The trtol value is a fudge factor, originally introduced by Nagel as a
estimate of how much the local truncation error is overestimated by
the divided difference formulas.  But, after looking at this in detail
some years ago, it is just a bug. The formula for estimating
derivatives by divided differences includes, for the third divided
difference, 3!.  Nagel dropped the 3! somewhere along the way; the
factor of 7 is a fairly close replacement -- but only for second order
integration, which uses the third divided difference.

Note that the spice code has a number of other problems:

-- the business of trying to use abstol to ensure that truncation
   error is no tighter than the nonlinear solution is buggy, and
   basically means that absol controls the timestep.

-- the gear code uses fixed-timestep truncation error coefficients

-- there are arithmetically better ways to estimate truncation error
   than using divided difference formulas; Brayton's method is good.

Back to trtol: After the above bugs are fixed, a fudge factor is still 
useful, but a value of 1.5 or 2.0 is more typical.

--Steve

Partial thread listing: