Your circuit has no damping (except the Rser=1m
default parasitic of the inductor, or the Rpar=1/Gmin
for the capacitor, if added), so what you see is not the "real" result. Since there is (virtually) no damping then there can be no damped oscillation, so the output should rise to infinity and, possibly, beyond. To correct the output you need to impose a tighter timestep. Here is how the output looks like for an increasing timestep of 1 s
(no effect since it's less than 1/1024
points, by default), then for 1 ms
, and then for 10 us
(1 us
will not be an improvement over 10 us
):
If it stops at 1 kV amplitude it's because of the Rser=1m
. If you set it to zero, it will do what you expect it to do. The reason has to do with how the SPICE engines calculate their timesteps and how very simple, linear circuits, such as this one, can influence it. TLDR: if it's simple and fast, the timestep shall not be constrained. Of course, the simulator tries to do what it can with the given input, so GIGO applies (which is your case: ideal voltage source, "pure" LC).