Discussion:
[geda-user] gschem and ngspice simulation
BERTRAND Joël
2014-03-15 15:13:01 UTC
Permalink
Hello,

I'm trying to use ngspice with gEDA without any success. I have
designed a very simple amplifier in gschem and created netlist with
gnetlist. I obtain :

C1 1 2 10uF
C2 0 3 10uF
Q1 3 2 Vout Q2N3904
R1 2 4 27k
R2 Vout 4 3k3
R3 0 2 2k
R4 0 3 100
R5 1 Vin 10
R6 0 1 2k
V1 4 0 DC 15V
V2 Vin 0 DC 1.5V AC 10MV SIN(0 1MV 1KHZ)
.MODEL Q2N3904 NPN(IS=1.4E-14 BF=300 VAF=100 IKF=0.025 ISE=3E-13
+ BR=7.5 RC=2.4 CJE=4.5E-12 TF=4E-10 CJC=3.5E-12 TR=2.1E-8 XTB=1.5 +
KF=9E-16 )

.OPTIONS NOPAGE NUMDGT=6 UNITS=Degrees WIDTH=104 ABSTOL=0.00
+CHGTOL=0.00 DEFL=0.00Meg DEFW=0.00Meg GMIN=0.00 PIVREL=-1.798E+306
+PIVTOL=0.00 RELTOL=-1.798E+306 TEMP=20.00
.PRINT TRAN V(Vout) V(Vin)
.TRAN 1.00m 1.00 0.00m

.END

ngspice only returns :

Transient solution failed -

Last Node Voltages
------------------

Node Last Voltage Previous Iter
---- ------------ -------------
1 0 0
2 0 3.49138e-07 *
3 0 9.46935e-17 *
vout 0 5.0625e-06 *
4 0 5.0625e-06 *
vin 0 0
v2#branch 0 0
v1#branch 0 -1.74569e-10 *



CPU time since last call: 0.048 seconds.

Total CPU time: 0.048 seconds.

Total DRAM available = 3561.660156 MB.
DRAM currently available = 520.246094 MB.
Total ngspice program size = 11.472656 MB.
Resident set size = 892.000 kB.
Shared ngspice pages = 591.000 kB.
Text (code) pages = 1.221680 MB.
Stack = 0 bytes.
Library pages = 334.000 kB.

Note: Starting dynamic gmin stepping
Trying gmin = 1.0000E-03 Warning: Further gmin increment
Trying gmin = 5.6234E-03 Warning: Further gmin increment
Trying gmin = 8.6596E-03 Warning: Further gmin increment
Trying gmin = 9.6466E-03 Warning: Further gmin increment
Trying gmin = 9.9105E-03 Warning: Further gmin increment
Trying gmin = 9.9775E-03 Warning: Further gmin increment
Trying gmin = 9.9944E-03 Warning: Further gmin increment
Trying gmin = 9.9986E-03 Warning: Further gmin increment
Trying gmin = 9.9996E-03 Warning: Last gmin step failed
Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to 0.0000% Note: One successful source step
Supplies reduced to 0.1000% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0100% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0015% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0002% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0000% Warning: source stepping failed
doAnalyses: Too many iterations without convergence

run simulation(s) aborted
Error(parse.c--checkvalid): vout: no such vector.

I have used spice a long time ago and I don't see where is my mistake.
Any idea ?

Best regards,

JB
Tom Russo
2014-03-15 15:35:08 UTC
Permalink
Post by BERTRAND Joël
.OPTIONS NOPAGE NUMDGT=6 UNITS=Degrees WIDTH=104 ABSTOL=0.00
+CHGTOL=0.00 DEFL=0.00Meg DEFW=0.00Meg GMIN=0.00 PIVREL=-1.798E+306
+PIVTOL=0.00 RELTOL=-1.798E+306 TEMP=20.00
It's these options, specifically the RELTOL setting. Why would you use
effectively negative infinity for the solver tolerance?

Remove RELTOL=-1.798E+306 and your circuit runs.
Post by BERTRAND Joël
Transient solution failed -
Note: Starting dynamic gmin stepping
Trying gmin = 1.0000E-03 Warning: Further gmin increment
Trying gmin = 5.6234E-03 Warning: Further gmin increment
Trying gmin = 8.6596E-03 Warning: Further gmin increment
Trying gmin = 9.6466E-03 Warning: Further gmin increment
Trying gmin = 9.9105E-03 Warning: Further gmin increment
Trying gmin = 9.9775E-03 Warning: Further gmin increment
Trying gmin = 9.9944E-03 Warning: Further gmin increment
Trying gmin = 9.9986E-03 Warning: Further gmin increment
Trying gmin = 9.9996E-03 Warning: Last gmin step failed
Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to 0.0000% Note: One successful source step
Supplies reduced to 0.1000% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0100% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0015% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0002% Supplies reduced to 0.0000% Note: One
successful source step
Supplies reduced to 0.0000% Warning: source stepping failed
doAnalyses: Too many iterations without convergence
run simulation(s) aborted
Error(parse.c--checkvalid): vout: no such vector.
I have used spice a long time ago and I don't see where is my mistake.
Any idea ?
Best regards,
JB
--
Thomas Russo * tvrusso-***@public.gmane.org * Tel: (505) 844-8644
Dept 1355, Electrical Models & Simulation * FAX: (505) 284-2518
Mail Stop 1177, Sandia National Laboratories *PAGER: (505) 283-2623
Albuquerque, NM 87185-1177 * CELL: (505) 469-0161

Give a man a program and you frustrate him for a day. Teach him to program
and you frustrate him for life. --- Anonymous

EXCEPTIONAL SERVICE IN THE NATIONAL INTEREST
Sandia is a multiprogram laboratory operated for the United States
Department of Energy by Sandia Corporation, a Lockheed Martin Company.
Tom Russo
2014-03-15 15:41:55 UTC
Permalink
Post by Tom Russo
Post by BERTRAND Joël
.OPTIONS NOPAGE NUMDGT=6 UNITS=Degrees WIDTH=104 ABSTOL=0.00
+CHGTOL=0.00 DEFL=0.00Meg DEFW=0.00Meg GMIN=0.00 PIVREL=-1.798E+306
+PIVTOL=0.00 RELTOL=-1.798E+306 TEMP=20.00
It's these options, specifically the RELTOL setting. Why would you use
effectively negative infinity for the solver tolerance?
Remove RELTOL=-1.798E+306 and your circuit runs.
Sorry, I mean remove PIVREL, PIVTOL and RELTOL settings and it runs.
And it is not a great idea to set the abstol and chgtol to zero,
either, even though this particular circuit runs fine with those
settings.
--
Thomas Russo * tvrusso-***@public.gmane.org * Tel: (505) 844-8644
Dept 1355, Electrical Models & Simulation * FAX: (505) 284-2518
Mail Stop 1177, Sandia National Laboratories *PAGER: (505) 283-2623
Albuquerque, NM 87185-1177 * CELL: (505) 469-0161

Give a man a program and you frustrate him for a day. Teach him to program
and you frustrate him for life. --- Anonymous

EXCEPTIONAL SERVICE IN THE NATIONAL INTEREST
Sandia is a multiprogram laboratory operated for the United States
Department of Energy by Sandia Corporation, a Lockheed Martin Company.
BERTRAND Joël
2014-03-15 16:27:54 UTC
Permalink
Post by Tom Russo
Post by Tom Russo
Post by BERTRAND Joël
.OPTIONS NOPAGE NUMDGT=6 UNITS=Degrees WIDTH=104 ABSTOL=0.00
+CHGTOL=0.00 DEFL=0.00Meg DEFW=0.00Meg GMIN=0.00 PIVREL=-1.798E+306
+PIVTOL=0.00 RELTOL=-1.798E+306 TEMP=20.00
It's these options, specifically the RELTOL setting. Why would you use
effectively negative infinity for the solver tolerance?
Remove RELTOL=-1.798E+306 and your circuit runs.
Sorry, I mean remove PIVREL, PIVTOL and RELTOL settings and it runs.
And it is not a great idea to set the abstol and chgtol to zero,
either, even though this particular circuit runs fine with those
settings.
Thank your for your answer. .OPTIONS statement directly comes from
gspiceui I have used a long time ago.

Regards,

JKB

Loading...