[free-electronic-lab] ngspice .PRINT I(<component>) won't work

Ashwith Rego ashwith at gmail.com
Mon Sep 13 19:10:00 UTC 2010


Hi
I've just begun using ngspice and found that I cannot plot the current
output. Also, I cannot specify the name of a circuit component in a .PRINT
or .PLOT statement. Only the node numbers seem to work. Here is an example:

Ohm' Law
Vin 1 0 5
R1 0 1 10K
.DC Vin 1 5 1
.PRINT DC V(R1)
.END

ngspice doesn't seem to recognize R1 in the .PRINT statement. I get the
following error:

$ngspice -b diff.net

Circuit: ohm's law

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Warning: can't parse 'r1': ignored
Error: no data saved for D.C. Transfer curve analysis; analysis not run
doAnalyses: not found

run simulation(s) aborted
Error: .print: no dc analysis found.
elapsed time since last call: 0.011 seconds.

Total elapsed time: 0.011 seconds.

Total DRAM available = 2008.300781 MB.
DRAM currently available = 423.984375 MB.
Total ngspice program size = 18.778320 MB.
Resident set size = 732.000 kB.
Shared ngspice pages = 551.000 kB.
Text (code) pages = 1.958008 MB.
Stack = 0 bytes.
Library pages = 5.961914 MB.
-------------------------------------------------------------------------------------------------
The simulation however works if I replace it with
.PRINT DC V(0,1)

Secondly, I can't seem to print current. Using
.PRINT DC I(R1) or .PRINT DC I(0,1) gives me this error:

$ngspice -b diff.net

Circuit: ohm's law

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Warning: can't parse '0#branch': ignored
Error: no data saved for D.C. Transfer curve analysis; analysis not run
doAnalyses: not found

run simulation(s) aborted
Error: .print: no dc analysis found.
elapsed time since last call: 0.013 seconds.

Total elapsed time: 0.013 seconds.

Total DRAM available = 2008.300781 MB.
DRAM currently available = 423.871094 MB.
Total ngspice program size = 18.778320 MB.
Resident set size = 733.000 kB.
Shared ngspice pages = 551.000 kB.
Text (code) pages = 1.958008 MB.
Stack = 0 bytes.
Library pages = 5.961914 MB.
--------------------------------------------------------------------------------------------

I don't see this happening in gnucap however (in this case V(0,1) will not
work). Am I doing something wrong or is ngspice meant to work this way? I
went according to the ngspice manual. I'm using Fedora 13 64-bit with Free
Electronic Lab groupinstalled.

Thanks! :-)

Ashwith J. Rego
-----------------
My Webpage: http://ashwith.wordpress.com/
Find me on LinkedIn at: http://www.linkedin.com/in/ashwith
Follow Me on Twitter at: http://twitter.com/Louisda16th
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/electronic-lab/attachments/20100914/bdfdb55d/attachment.html 


More information about the electronic-lab mailing list