AC transient analysis for LR series circuit for a given AC source?
Analytic solution using Laplace Transform

I manually solved this problem with a lot of algebra (it took me four pages), using a concept of circuit analysis called Laplace Transform. I don't know if you know how to use it, but it is very useful to obtain mathematical equations precisely, when you want them.

For the sake of brevity I will only post the final result here, especially because I don't have the time to patiently write the solution in LaTeX right now.

Assumptions:


Voltage source is \$v(t) = A \cos (\omega t + \phi)\$
Initial current (at \$t = 0^-\$) on the inductor is \$I_0\$


Result:


calling \$i_t(t)\$ is the transient current
calling \$i_s(t)\$ is the steady state current
\$u(t)\$ is the Heaviside Step Function
writing \$\exp(x)\$ for \$e^x\$


$$i(t) = i_t(t) + i_s(t)$$

where 

$$i_t(t) = I_0 \exp\left(-\frac{R}{L}t\right)u(t) - \dfrac{A}{R^2 + \omega^2 L^2}\left(R\cos \phi + \omega L \sin \phi\right) \exp\left(-\frac{R}{L}t\right)u(t)$$

and

$$i_s(t) = \dfrac{A}{\sqrt{R^2 + \omega^2 L^2}}\cos \left(\omega t + \phi - \arctan \dfrac{\omega L}{R}\right) u(t)$$

Interpretation of the result


The steady state current clearly matches the expected
The transient current indeed vanishes at \$t = \infty\$, unless \$R = 0\$. It is interesting to note that LTSpice has a default value of \$1 \text{ m}\Omega\$ as the series resistance of an inductor, so if you wait enough, the simulation will reach the steady state, as you noticed.




Using the equations to analyze the case where \$I_0 = 0\$, \$R = 0\$ and we are using a sine wave


To analyze a sine voltage source, we put \$\phi = -\frac{\pi}{2}\$ (since \$\cos (\omega t - \frac{\pi}{2}) = \sin (\omega t)\$.
If I'm not mistaken, LTSpice defaults to \$I_0 = 0\$ on inductors.


Setting \$\phi = -\frac{\pi}{2}\$, \$I_0 = 0\$ and \$R = 0\$ on the obtained equation yields:

$$i_t(t) = \dfrac{A}{\omega L}u(t)$$

$$i_s(t) = \dfrac{A}{\omega L}\cos \left(\omega t + \frac{\pi}{2} - \frac{\pi}{2}\right) u(t) = -\dfrac{A}{\omega L}\cos (\omega t) u(t)$$

$$\implies i(t) = \dfrac{A}{\omega L}(1 - \cos (\omega t))u(t)$$

Therefore, the current will oscillate forever between 0 and \$\dfrac{2A}{\omega L} \approx 5.3052 A\$, with a mean value of \$\dfrac{A}{\omega L} \approx 2.6526 A\$, which is precisely what your simulation shows!! Impressive. I am indeed amazed on how great LTSpice was this time.



Using the equations to analyze the case where \$I_0 = 0\$, \$R = 0\$ and we are using a cosine wave

Just follow the same steps for the sine wave, but now you use \$\phi = 0\$ (instead of \$-\frac{\pi}{2}\$), since we want a cosine wave. Hint: since \$R = 0\$, the whole \$i_t(t)\$ becomes a constant.

The expected result is hidden below (in a "spoiler" markup - hover your mouse to see the answer):


   \$i(t) = \dfrac{A}{\omega L}\sin (\omega t)u(t)\$




About the huge current on your cosine wave simulation

According to LTSpice user guide, page 68:


  The .ic directive allows initial conditions for transient analysis to be specified. Node voltages and inductor currents may be specified. A DC solution is performed using the initial conditions as constraints. Note that although inductors are normally treated as short circuits in the DC solution in other SPICE programs, if an initial current is specified, they are treated as infinite-impedance current sources in LTspice.


This means that if you don't do anything about it, LTSpice will start considering inductors as short-circuits for a transient analysis. If they start as short-circuits, of course the starting current will be huge. In fact, since we also know that LTSpice includes a series resistance of \$1 \text{ m}\Omega\$ with the resistor, we actually predict those 10 KA as well (10 V divided by 0.001 ohm). Now, if you don't want this behaviour, you can use a SPICE directive such as .ic I(L1)=0, and the simulation will now match the predictions of my equations above (see for yourself). I did it here, and it worked for me. Also, instead of using a SPICE directive, you can go to Edit Simulation Command and check the checkbox Skip Initial operating point solution. Both ways worked for me, with the simulation now showing a sine wave, as my equations would expect.



Wikipedia page on Laplace Transform - example of studying a capacitor

I know this answer can be heavily improved if I include my calculations instead of just the final result, but I really don't have time to type all that LaTeX right now. I might do it on another time.