[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gnucap] Possibly a bug?
From: |
Orestes Mas |
Subject: |
[Help-gnucap] Possibly a bug? |
Date: |
Wed, 22 May 2013 11:59:23 +0200 |
User-agent: |
KMail/4.10.2 (Linux/3.8.0-21-generic; KDE/4.10.2; x86_64; ; ) |
Hello,
I'm obtaining unexpected results (NaN) when simulating a simple circuit:
Test circuit
Vg 1 0 AC 1
R1a 1 2 33K
R1b 4 5 33K
Rpa 2 3 470K
Rpb 3 4 0K
C1 2 4 6.8n
E1 5 0 0 3 1e6
.PRINT AC vdb(5)
.AC DEC 500 0.1 100K
.END
This circuit is a lowpass tone control build around an Operational Amplifier,
which in this example is modelled as a high-gain VCVS.
In this circuit the high-frequency gain is always 0dB and the low frequency
gain can be adjusted between (roughly) -23dB and 23dB by properly changing the
values of Rpa and Rpb, which model the left- and right- sides of a
potentiometer, hence the "0k" value of Rpb in this case.
I normally use the "fault" command to change the values of Rpa and Rpb to
simulate adjusting the potentiometer cursor to a different position (I don't
know if there's a better way to do this, suggestions are welcome)
Gnucap's output is:
Test circuit
#Freq vdb(5)
0.1 NaN
0.10046 NaN
0.10093 NaN
0.10139 NaN
0.10186 NaN
0.10233 NaN
(...) an so on
Context:
1) My gnucap version:
Gnucap 2009.12.07 RCS 26.136
2) I've tested the same circuit with gnucap 0.35 and THIS DOESN'T HAPPEN, so
maybe this is a bug introduced in the development version. Am I right?
3) Changing the "short" option doesn't improve the situation.
4) -- IMPORTANT -- Simulation is ok if I issue an OP analysis BEFORE the AC
one. I know this is mandatory for nonlinear circuits, because operating point
must be calculated before small-signal analysis, but I thought the OP analysis
was irrellevant and unnecessary with circuits containing only linear models,
and this is the behaviour in the stable release. It seems it's no longer the
case. If soo, why not do an OP analysis automatically before every AC one? If
I remember correctly, this is precisely what spice does...
Any comment on this will be greatly appreciated.
--
Orestes Mas.
- [Help-gnucap] Possibly a bug?,
Orestes Mas <=