Share

ngspice

Tracker: Bugs

5 IM() and IP() seem not to work in .PRINT statement - ID: 2808736
Last Update: Comment added ( nobody )

I am running a small AC testcase on an R-L-C circuit.

This .print statement works:
.print ac vm(2) vp(2) vm(3) vp(3)

This one does not:
.print ac im(vin) ip(vin) vm(2) vp(2) vm(3) vp(3)

I receive a warning 'Warning: can't parse 'vin': ignored'.

I am running ng-spice-rework-19 on fedora core 10.


Scott McMullen ( scottmcmullen ) - 2009-06-18 23:46

5

Closed

Rejected

Holger Vogt

analyses

None

Public


Comments ( 2 )




Date: 2009-06-29 15:23
Sender: nobody

Okay; thanks a lot for your help.

I read this in the manual (from section 4.4.2 in the Spice3 manual, and
section 9.4.2 in the ngspice manual):

I(VXXXXXXX)
specifies the current flowing in the independent voltage source named
VXXXXXXX. Positive current flows from the positive node, through the
source, to the negative node. >>> For the ac analysis, the corresponding
replacements for the letter I may be made in the same way as described for
voltage outputs. <<<

and assumed that it meant that IR(), II(), IM(), IP(), and IDB() would
behave in an analgous way to
voltage measurements. So is the manual incorrect?

Regards,

Scott


Date: 2009-06-28 14:17
Sender: h_vogtProject Admin

Scott,

VR - real part; VI - imaginary part; VM - magnitude; VP - phase; VDB -
20*log10(magnitude)
are o.k. in spice3 and ngspice (see
http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/sec4.html).

IR - real part; II - imaginary part; IM - magnitude; IP - phase; IDB -
20*log10(magnitude)
are not defined in ngspice and have not been defined in spice3.

You may use mag(i(vin)) and ph(i(vin)) instead.

Your input file may look like:

series rlc circuit
*

vin 1 0 0 ac 5 0
l1 2 3 0.125
c1 3 0 1u
r1 1 2 200
.ac lin 10 1 10
* this print statement works
*.print ac vm(2) vp(2) vm(3) vp(3)
* this print statement does not work
*.print ac im(vin) ip(vin) vm(2) vp(2) vm(3) vp(3)
.print ac mag(i(vin)) ph(i(vin)) vm(2) vp(2) vm(3) vp(3)

.control
set units = degrees
.endc
.end


Regards

Holger



Log in to comment.

Attached File ( 1 )

Filename Description Download
rlc.ckt R-L-C circuit testcase Download

Changes ( 6 )

Field Old Value Date By
status_id Open 2009-06-28 14:17 h_vogt
resolution_id None 2009-06-28 14:17 h_vogt
category_id None 2009-06-28 14:17 h_vogt
assigned_to nobody 2009-06-28 14:17 h_vogt
close_date - 2009-06-28 14:17 h_vogt
File Added 331514: rlc.ckt 2009-06-18 23:46 scottmcmullen