Maker Pro
Maker Pro

SPICE accuracy?

  • Thread starter Vladimir Vassilevsky
  • Start date
V

Vladimir Vassilevsky

Jan 1, 1970
0
Suppose there is a nonlinear circuit with the vastly different time
constants. An example could be RF oscillator; the time scale of events
is a fraction of RF period; whereas the RC bias time constant is
somewhat 10M times slower then the period.

When simulating this circuit in *.SPICE, is there any loss of accuracy
due to accumulation of the very small increments in a part with the long
time constant? Is there any way to estimate that sort of accuracy loss?


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
 
V

Vladimir Vassilevsky

Jan 1, 1970
0
Tim said:
Spice is pretty good at sensing that situation and really cutting down
the simulation interval.

That "cutting down similation interval" is what I am worried about. It
should have the similar effect as the loss of precision in the digital
filters when Fc/Fs is too high.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
 
V

Vladimir Vassilevsky

Jan 1, 1970
0
John said:
Probably not. Spice generally uses double floats, which have lots of
dynamic range.

Speaking very approximately, a traditional digital filter of the Nth
order looses the dynamic range as Q*(Fc/Fs)^N. So, if the timeconst
ratio is 10M, then the filter of the only 2nd order will gobble the
double float precision. I don't know if this consideration is valid for
the SPICE engine though.
The bigger problem is that you need small time steps to model the fast
bits accurately, so if there are also slow things going on, the sim
may take a long time - hours maybe - to settle out.

Yes, yes, yes. A comprehensive simulation of something like RF OFDM
amplifier could take weeks. It is faster to try the things on the prototype.
Things with high
Qs, like crystal oscillators, are especially nasty. I simulate XOs
mostly in the frequency domain, which is fast.

That assumes the reasonable linearity; when you are after
nonlinearities, there is no choice.
You can sometimes force some initial conditions to jump ahead in time.

To resolve time-step and math resolution effects, just run a few sims
with different time steps. If the results are the same, you're not
bumping up against any artifacts.

You can also tweak the RELTOL and other tolerances; they have the
pronounced effect on the speed vs accuracy.

Can you recommend a good book about the details of the SPICE engine?


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
 
O

oopere

Jan 1, 1970
0
To simulate this kind of circuits, the best approach is to make use of
tools that directly compute the steady state without having to integrate
the equations during the (long) transient.
You may choose among time domain techniques:

-Shooting methods: you try to guess (Newton) the initial state that
starts the circuit directly in the steady state.
-Discrete time techniques: you try to find (again, Newton and
derivatives) a set of N samples of the circuit waveform in the steady state.

or, in the frequency-domain:
-Harmonic balance: you try to find (idem) the amplitude and phase (or
real and imaginary part) of N harmonics of the solution in the steady state.

That said, PSpice should give you the "right" answer in spite of the
largely different time constants, provided you are able to wait long
enough and have a way to detect when you are in the steady state (which
is by no means obvious in this kind o f circuits). However, to provide
useful results in this kind of circuits (strong nonlinearity), you have
to manually limit the time step to something reasonable (from 10 to 100
samples per RF period), which increases simulation time.
Speaking very approximately, a traditional digital filter of the Nth
order looses the dynamic range as Q*(Fc/Fs)^N. So, if the timeconst
ratio is 10M, then the filter of the only 2nd order will gobble the
double float precision. I don't know if this consideration is valid for
the SPICE engine though.


Yes, yes, yes. A comprehensive simulation of something like RF OFDM
amplifier could take weeks. It is faster to try the things on the
prototype.


That assumes the reasonable linearity; when you are after
nonlinearities, there is no choice.


You can also tweak the RELTOL and other tolerances; they have the
pronounced effect on the speed vs accuracy.

Can you recommend a good book about the details of the SPICE engine?

A reasonably good book on PSpice details is Kenneth S. Kundert's "The
Designer's Guide to SPice & SPectre". I seem to recall another title
"Inside PSpice (or similar)" but I can't dig it up right now.
 
Top