# Ideal LC circuit decays over time in LTspice

I was trying to simulate a transformer without a load, and setting an initial condition to observe how the energy will flow from the primary to the secondary circuit.

I realized that the energy will decay and the waveforms I would get I was not able to interpret, thus I simplified my question to a simple LC circuit which I simulate with LTspice by setting an initial condition. Plotting the voltage of the circuit will correctly give me an oscillation of 18MHz but increasing the simulation time will show that the voltage will decay.

My question is why do I get this response? Since I have no resistive components the oscillation should not dampen. The only assumption I can make is that simulation has a finite time for numerical integration and this might affects the results (?). If so, what parameters could I change to see an ongoing oscillation? I also tried to change Gmin and Abstol but I did not see much of a difference.

• Sometimes LTspice will add a small resistance in series with an inductor to improve convergence. Check the properties of your inductor and look for something like 'Rser'. – Elliot Alderson Apr 17 at 11:59
• Thanks, this is a good catch I just noticed that inductor uses a 1mΩ series resistance by default. Now I am looking into ways of how to reduce it. I tried using a negative resistance instead but it seems that this is not working. Any ideas of how can I do that? – Christts Apr 17 at 12:34
• Take a look at the "settings" or "preferences" or whatever they are called. As I recall this is an option you can disable, or at least set the value to zero. – Elliot Alderson Apr 17 at 12:39
• Thanks for your help, I realized from the answer below that setting Rser is not enough, and inductor will work ideally if I define Rpar to zero as well. – Christts Apr 17 at 12:59

You need to set both Series and Parallel resistance to 0.
It makes no sense, but it works. Setting only the Series resistance will not solve OP's problem.

EDIT

For general component values LTspice will accept numbers that range in magnitude from as large as ± 1.798 x 10+308 down to as small as ± 2.225 x 10−308.  Values exceeding this range are interpreted as ± infinity or as zero.
Source

If you set a voltage source to a voltage of {1.8*10^308}, it will plot zero volts.

It seems it also works the other way around (setting Parallel resistance to 0), but setting Parallel resistance to {2*10^308} also works. The latter makes more sense.

• Thanks! I realized I while ago that changing Rpar to 1T will give me a very slow decay. However, what you suggest works ideally. – Christts Apr 17 at 12:58

Here's a good discussion of the issue: http://ltwiki.org/LTspiceHelp/LTspiceHelp/L_Inductor.htm In essence, LTspice includes a small series resistance by default with every inductor. This allows LTspice to use a simpler technique for modeling the inductance. If you don't want the series resistance, you have to manually change the value of Rser to zero.