Electronic – the cause for a 180 phase shift between current and voltage in LT-spice simulation

ltspice

Just by clicking on the resistor, I got a display of the plot of current passing through it, marked with I(R3). In my opinion it must be in phase with the voltage across the resistor, but on the screenshot it seems to be different, could anyone help me to understand it?

enter image description here

Best Answer

Turn the resistor around. :)

Electric current has a direction, it is not a scalar property of a resistor. And there is no a priori given "positive" direction neither. Spice simply assumes that the current flowing from one resistor terminal to another has positive sign and opposite direction is displayed as negative. Because terminal numbering is "hidden" and the visual symbol has both terminals indistinguishable, it can be a bit perplexing.

LTspice will hint you what is the positive current direction by changing the cursor shape when you hover it over the component in "probe" mode.