Can't get a print of voltages between nodes from this SPICE (NGSPICE) simulator.

Status
Not open for further replies.

sr13579

Member
The code is here,
Diode Voltage Drop
r1 1 2 10k
r2 2 3 5k
r3 3 4 4k
r4 4 0 3k
vin 1 0 dc 10
.print dc v(3,2)
.end

As you can see I am trying to get a voltage drop between node 3 aand 2. But the print function is not working properly. It is just showing the usual outputs of( the ouput is attached with documents). How am I supposed to fix this?
 

Attachments

  • Screenshot_20180125-223615.png
    62 KB · Views: 384
I dunno. LTSpice doesn't seem to support the .print v(3,2) syntax. It does (as a plotting function) if you do a .dc swept analysis, but there seems no way to do it in a .OP analysis without adding an extra node driven by a behavioral voltage source whose function definition is V=V(3,2) or V=V(3)-v(2)
 
Diode Voltage Drop
r1 1 2 10k
r2 2 3 5k
r3 3 4 4k
r4 4 0 3k
vin 1 0 dc 10
.dc vin 0 10 1
.print dc v(3,2)
.options NOACCT
.end


You need to run the dc analysis first. The output of plain ngspice-28 in batch mode then is:

Circuit: diode voltage drop

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000



No. of Data Rows : 11
diode voltage drop
DC transfer characteristic Fri Jun 29 12:35:05 2018
--------------------------------------------------------------------------------
Index v-sweep v(3)-v(2)
--------------------------------------------------------------------------------
0 0.000000e+00 0.000000e+00
1 1.000000e+00 -2.27273e-01
2 2.000000e+00 -4.54545e-01
3 3.000000e+00 -6.81818e-01
4 4.000000e+00 -9.09091e-01
5 5.000000e+00 -1.13636e+00
6 6.000000e+00 -1.36364e+00
7 7.000000e+00 -1.59091e+00
8 8.000000e+00 -1.81818e+00
9 9.000000e+00 -2.04545e+00
10 1.000000e+01 -2.27273e+00
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…