Re: [ng-spice-devel] TRtol setting. Speed vs. accuracy
At 9:46 am -0400 27/8/01, Jon Engelbert wrote:
>Al (and others),
>In my spice program (b2 Spice A/d 2000), I took parts of xspice and merged
>them with spice3f5. One of the changes in xspice nearly doubles the
>transient simulation time. In the comment, it suggests that it was changed
>[...]
>As you can see, TSKtrtol has been changed from 7 to 1, which later gets
>passed to ckt->CKTtrtol, which is used in CKTterr which is in turn used to
>determine truncation errors for many of the device types. In practice, this
>results in the transient taking a lot longer to settle on each "next" time.
>
>I don't understand this very well, but I have profiled it both ways and
>stepped through it so I'm confident that I have the general idea correct.
>Since this parameter plays such a big role in simulation speed, I'd like to
>understand it better, and if anyone can help, I'd appreciate it.
TRTOL was introduced because the LTE algorithm (the default time-step
control algorithm) can provide a more accurate than the IC method,
but the result is better only if the truncation error estimate is
accurate. It was discovered empirically (by Nagel?) that the
estimates derived from the 3rd divided difference formula were
typically about seven times to big. Hence TRTOL=7.
There are cases (AFAIR sinusoidal oscillators are one such) where the
3DD formula provides hopeless estimates and one should use the IC
time-step.
IMHO the TRTOL parameter is best left at 7.
P.S. The other LTE parameter CHGTOL was also introduced during
development of the LTE tim-estep algorithm, and this is also best
left at the default value.
Hope this helps
Charles
Partial thread listing: