The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Why do derivatives in swept-dc get inaccurate for smaller stepsizes?
https://designers-guide.org/forum/YaBB.pl?num=1475559676

Message started by exp on Oct 3rd, 2016, 10:41pm

Title: Why do derivatives in swept-dc get inaccurate for smaller stepsizes?
Post by exp on Oct 3rd, 2016, 10:41pm

I would like to obtain linearity (IIP3) from swept dc analysis.
The circuit is a simple NMOS operated as a switch and nonlinearity is Ron nonlinearity.
Source has a voltage source with series resistance Rs and drain is grounded. Drain current is measured via ccvs.

The coefficients are obtained from

c1 = value(deriv(v("/vout")) 0)
c3 = value((deriv(deriv(deriv(v("/vout"))))/6) 0)

and IIP3 = dB10(4/3*abs(c1/c3))+10

Hoewever, contrary to common wisdom, results get worse when the stepsize is decreased. A closer look shows that the traces become noisier.

For an example, see attached deriv3.pdf which shows the noise trace with step size 10uV and the less noisier one with 100uV.

Why is this and how can it be avoided?

How can I get reliable and accurate c1/c3/IIP3 values from swept DC analysis?

Thank you!!
esp


Title: Re: Why do derivatives in swept-dc get inaccurate for smaller stepsizes?
Post by Geoffrey_Coram on Oct 4th, 2016, 9:46am

Have you tried changing the tolerances?

But you may be running into issues with numerical precision of computer arithmetic.

Title: Re: Why do derivatives in swept-dc get inaccurate for smaller stepsizes?
Post by exp on Oct 4th, 2016, 9:55am

Hi,

Yes, tightened tolerances (reltol, iabstol, vabstol) and no difference.

I thought about numerical issues BUT: With stepsize=50uV? Can't be. And: In a swept DC, the different runs are indenepdent. Huge fluctuations do not make sense.

I tried it with both SpectreRF and AFS. Same!

I also found the problem becomes more pronounces if I add a series resistance to the nonlinear resistor (MOSFET). Makes no sense to me.

For better understanding: Here is the simple setup:






Title: Re: Why do derivatives in swept-dc get inaccurate for smaller stepsizes?
Post by Ken Kundert on Oct 4th, 2016, 12:49pm

Fundamentally trying to take a triple derivative is a bad idea. The smallest errors get amplified, amplified, and then amplified again.

Find another way that does not involve triple derivatives.

-Ken

Title: Re: Why do derivatives in swept-dc get inaccurate for smaller stepsizes?
Post by exp on Oct 4th, 2016, 1:08pm

Thanks, Ken!

So are you saying I should forget about obtaining linearity from swept-dc in the first place? (by definition, it involves tripe derivatives).

My issue is that qpss/shooting+qpac, qpss/hb+qpac, hb, ... all give me non-monotonic (and hence non trustworthy) IIP3 curves. Even after tightening all tolerances to the maximum with simplistic circuits. It may be the models (however, it is a PSP-like model, so the known VDS0->0 cannot be an issue) but I cannot change the models. That was the reason to go to a simple DC sweep first.

Do you have any other idea how to extract IIP3 if swept-dc, hb, shooting fails?
(tran+dft would be an option but it takes too long and much fine tuning)

Thank you!
exp

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.