I have a relatively simply netlist and I want to know the node voltages/currents through all components. The netlist is:

V1 0 4 dc 10
R1 0 1 2k
R2 1 4 4k
R3 1 4 2k
R4 1 2 6k
R5 2 3 10k
V2 3 4 dc 20
.dc v1 10 10 1

I try running this in batch mode with the commmand

`ngspice -b -r circuit2.raw -o circuit2.log ../../circuit2.cir'

and my .raw file just has the variable names, but not their values:

Title: circuit2
Date: Thu Aug 03 10:16:31  2017
Plotname: DC transfer characteristic
Flags: real
No. Variables: 7
No. Points: 1       
    0   v(v-sweep)  voltage
    1   v(4)    voltage
    2   v(1)    voltage
    3   v(2)    voltage
    4   v(3)    voltage
    5   i(v2)   current
    6   i(v1)   current

How do I get it to say "i(v2) = whatever" instead of just naming my variables? Is it also possible to get the currents/powers through all of my components in a similar way?


You are doing a dc sweep from 10V to 10V with 1V step, which is nonsense. To print values you should use the .print command. eg. .print v(1) v(2) v(3) v(4) i(v1) Hope it helps. Joao


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.