Re: [ng-spice] Pole-zero analysis (and others)
Hi!
Sorry for my late reply. I had no time.
> Do you have any example circuits you can submit to show this problem?
Try this one (from an earlier ngspice distribution, i think):
q1-2
v1 1 0 0 ac 1.0
r1 1 2 1k
c1 2 0 10p
e2 3 0 2 0 10
r2 3 4 1k
c2 4 0 1.25p
e3 5 0 4 0 10
r3 5 6 1k
c3 6 0 .02p
.pz 1 0 6 0 vol pz
.print pz all
.end
With rework-11 (with my 2 earlier patches):
Circuit: q1-2
ngspice 1 -> run
internal error -- segmentation violation
Same as above, but with AN_* moved to dev.c:
Circuit: q1-2
ngspice 1 -> run
Warning: Pole-zero iteration limit reached; giving up after 319 trials
ngspice 2 -> print all
pole(1) = -1.00000e+08,4.654316e-306
pole(2) = -1.00000e+08,-4.65432e-306
ngspice 3 ->
It does not crash, but the result is still wrong.
Let's try spice3f5:
Circuit: q1-2
Spice 191 -> run
Spice 192 -> print all
pole(1) = -5.00000e+10,0.000000e+00
pole(2) = -8.00000e+08,0.000000e+00
pole(3) = -1.00000e+08,0.000000e+00
Spice 193 ->
Which is the correct result. I don't remember if this is the original spice3f5
or if i changed something.
Since moving AN_* only solves one part of the problem, this is not a proof
that moving AN_* into dev.c corrects anything but you can take a debugger,
set a breakpoint to VSRCpzSetup() and see that VSRCpzSetup() is not called
before the crash. The program crashes in VSRCpzLoad() while accessing
*(here->VSRCibrIbrptr). This pointer is only initialized in VSRCpzSetup().
If you now look into vsrcitf.h, which is included in dev.c, you see, that
VSRCpzSetup() is not included in VSRCinfo, if AN_pz is not defined.
A segmentation fault does not always happen. Sometimes you get something like
the following:
Circuit: test pz
ngspice 1 -> run
Warning: Source iin has no value, DC 0 assumed
doAnalyses: input or output shorted
run simulation(s) aborted
ngspice 2 ->
Regards,
Manni
Partial thread listing:
- Re: [ng-spice] Pole-zero analysis (and others), (continued)