LC Circuit Simulation in Pspice

Thread Starter

Chacabucogod

Joined Nov 16, 2013
26
Hi,

I was doing an LC circuit with voltage source simulation both in pspice and in mathematica when I noticed that the current in the simulations are different. Anybody knows why pspice is giving me that error? Both the voltage in the capacitor and in the inductor are the same in both simulations, but the current in the pspice simulation is shifted by 180 degrees; furthermore; when I check the current in the capacitor node it gives me the right value.





Thank you
 

mvaseem

Joined Jan 31, 2014
48
Pspice shows current coming out of a device as negative of current entering into device.
When you put probe on capacitor (plus treminal), you get current entering into the device. When you put probe on voltage source terminal, it is current coming out of source, so it is opposite polarity.
 

WBahn

Joined Mar 31, 2012
30,058
Why do you conclude that PSpice is giving an error? Did you define your Mathematica current directions so that they are consistent with the PSpice convention?

By convention, Spice simulators define current at a pin as being the current entering the pin. This is so that the simulator doesn't have to be concerned with whether a pin is an output pin or an input pin or a power pin or a bi-directional pin.
 

MikeML

Joined Oct 2, 2009
5,444
I'm sure PSpice uses the same convention as LTSpice. Note that -I(V1) = I(L1) = I(C1).

252.gif
 
Last edited:

WBahn

Joined Mar 31, 2012
30,058
For two terminal devices, it makes sense to ask what is the current in the device. The convention is that this means the current into Pin 1, which is synonymous with the current through the device from Pin 1 to Pin 2. Since the current at a pin is defined as the current into the pin, this also means that the current in a two-terminal device is the same as the current at Pin 1 and so it is a simple matter of translation.

Look at your diagram. You say that the dashed arrows give the current direction. Since this is a series circuit and since your arrows are all shown going clockwise around the circuit, these currents must all be the same, in both magnitude and direction, at all times. Yet in order to satisfy KCL at Node A you are having to take the negative of the current in the supply! The reason is that the current in the supply is defined as the current INTO Pin 1 (which is the positive terminal of the supply). If that isn't sufficient, ask whether you expect the current, according to the dashed arrow you have next to the supply, to start out going positive or negative and then compare that to the simulation results.
 
Top