Electronic – LTSpice Simulation Showing Inaccurate Results and Excessive Current

circuit analysiserrorltspice

So I'm trying to make the following simulation work properly to verify some hand solving for a circuit. The circuit is an LC tank with some diode clamping, and an initial capacitor voltage of -50V.

I tried both with and without a switch to see if that helped…it didn't.

attempt1
attempt2

Solving for this by hand I expected to see around 300A as the initial surge current, but it's up in the high kA range in the simulation. I know this can occur with LTSpice time base errors, but here's the stranger part

I had it working fine, then accidentally didn't save the changes. Now I can't make it work properly for some reason. I've tried:

  • all the integration modes
  • normal/alternate solver
  • Taking the maximum timestep all the way down to 1E-12…took forever but it didn't help.

Nothing seems to make this simulation behave properly. Is there anything else I can try? I don't know why it isn't working now as opposed to earlier.

Thanks!

Best Answer

Suffixes in LTspice are not case sensitive, so your switch's off resistance Roff=1M is actually 1 milliohm not 1 Megohm. Change it to Roff=1Meg and it will work.

Without a switch you get several thousand Amps because the initial conditions are calculated at DC and inductors are considered to be short circuits. The inductor in your circuit has close to 150V across it, so the initial DC current is very large.