# Miscalculation of current for a pure inductive circuit in LTspice

A 10mH inductor is coupled to a 10V 60Hz AC supply as in the below circuit: Solution of the current amplitude for this pure inductive circuit is given as: But when I simulate this circuit in LTspice I'm having the following plot for the current which is twice what it supposed to be: What am I doing wrong here?

edit: Current supposed to alternate:  LTspice and some other simulators plots the current as if it is not alternating. Why?

• Try starting the voltage waveform at exactly its peak. Then all should be come clear. May 21, 2016 at 19:48

LTSpice defines the sine wave in terms of the amplitude of the sine wave. The amplitude is the $A$ in the form $A \sin\left(\omega t + \phi\right)$. Since the sine function ranges from -1 to +1, the peak-to-peak range of the sine wave is $2A$ as you observed.

If you want a sine wave with 10 V rms amplitude, you need to tell LTSpice the amplitude is 14.14 V.

In LTspice simulation it is not alternating. Why?

Because in SPICE, unless you direct it otherwise, the current in the inductor starts at 0. To get the result you expect you have several options:

• Change the phase of the source by 90 degrees to create a cosine source.

• Use an .IC directive to set the initial current through the inductor.

• Run the simulation for long enough (maybe 100 cycles?) for the initial transient due to the initial conditions to decay, resulting in the steady-state behavior. You may need to add some loss mechanism (like a small series resistor) for this to give the expected result.

Edit

I had the same concern as W5VO that the transient wouldn't settle in the idealized world of the situation, which is why I recommended adding a loss element. But when I try the simulation, LTSpice actually produces the expected results, even without adding loss explicitly. I suspect this is because of the "GMIN" elements added between each node and ground Massimo Ortolando pointed out in comments that this is because LTSpice automatically adds a non-zero resistance term to any inductor, unless the series resistance is explicitly set to 0 or a program setting is changed: • So you mean in the expression: "10V 60Hz AC supply" 10V is rms voltage hence the amplitude should be 10*sqrt(2) = 14V? But if I divide 14 by X I get now 3.72. I didn't understand what you meant May 21, 2016 at 15:11
• No, in the LTSPICE description "SINE(0 10 60)", the 10 is the $A$ in the expression $A\sin(\omega t + \phi)$. The rms value would be $A/\sqrt{2}$. May 21, 2016 at 15:13
• Ok but in the formula for "10V 60Hz AC supply" 10V is also amplitude which swings from -10V to +10V. I cant see any difference between the formula and the LTspice for the voltage definition. Sorry I still didnt get it.. May 21, 2016 at 15:15
• I edited my question. Current supposed to alternate. In LTspice simulation it is not alternating. Why? May 21, 2016 at 15:22
• @user16307 The general solution of a linear ordinary differential equation (have you studied differential equations in maths?) is given by the sum of the solutions of the associated homogenous equation (the transient or zero input response) and a particular solution (typically one takes the steady-state solution). May 21, 2016 at 21:34

Your calculation is correct. Since the amplitude of the voltage source is 10 V, the amplitude of the current signal should be 2.65 A. Now, take a closer look at the current waveform the simulation gives you. It is oscillating between what values? 0 A to 5.5 A. What is the amplitude of such signal? About 2.75 A. Therefore, there is nothing wrong here.

The source of confusion is the fact that the current waveform generated by your simulation does not oscillate around 0, it instead oscillates around about 2.75 A.

EDIT to address edit in question: What you're seeing is a transient behaviour. Refer to The Photon's answer for the correct explanation. My previous explanation (now removed) was incorrect.

• I dont get it. 10V 60Hz AC supplly means 10V amplitude hence -10 to +10 swing already. I really didnt get what you mean. May 21, 2016 at 15:12
• Correct. Do you agree that the current you calculated is also the amplitude of the current? What is the amplitude of the current you see in the simulation? Despite the peak value being ~5.5A, if you take a closer look, you will see that the amplitude is indeed ~2.75 as you calculated, since is it oscillating between 0 and 5.5. May 21, 2016 at 15:14
• But doesnt current supposed to swing from -2.75 to +2.75? May 21, 2016 at 15:18
• I edited my question. Current supposed to alternate. In LTspice simulation it is not alternating. Why? May 21, 2016 at 15:23
• Please see here books.google.dk/… Where it shows how the current alternates which doesnt happen in LTspice simulation Either the books are wrong or the simulations. Im confused. May 21, 2016 at 15:43

Because you circuit do not reach "steady state". Only in "steady state" the current will alternate equally around 0 value (average value is zero).

To fix this add 1 Ohm's series resistor with the inductor and the circuit will reach "steady state" after 5*10mH/1ohm = 0.01s = 10mS. Or if you use 0.1Ohm's resistor the circuit will reach "steady state" after 5* 10mH/0.1Ohm = 0.5s = 500ms. Without resistor the circuit will never reach the "steady state".

• but if the circuit is pure inductive, the resistor will be zero and the circuit won't reach "steady state" in theory right? May 21, 2016 at 20:23
• Right, with a perfect inductor the DC current in the inductor will persist forever. Oct 19, 2016 at 22:43