ltspice (or any simulator really) is only an approximation to both, reality and ideal components. Reality because it can not model all the details reality depends upon, and ideal because it can not run with infinite precision in values and time.
Basically how any spice works is that for the next timestep it checks all involved complex formulas and matrices, and if they converge within the required number of iterations into values with error tolerances below those specified with the *tol
options, then it will go on. If not, it will lower the timestep and try again, until it either reaches a limit and errors out, or the tolerance is met.
reltol
is the paramter used to specify a certain accepted error relative to the next timestep. The error is estimated using a polynomial to "predict" the value at the next chosen timestep, then it is actually computed there, and the difference taken. If its too big, make the timestep smaller.
This also means that instead of those parameters, you can make the simulation more accurate by forcing a really small timestep like 1n
but that makes things really really slow, the dynamic timestep feature is one of the things that make it much faster.
Together with trtol
(which specifies a factor on overestimation of the actual error) these are the major knobs you want to play with to either make the simulation more accurate, or faster.
Additionally, ltspice internally uses floats, so sometimes .opt numdgt=7
(anything over 6) is needed to force it to use doubles instead, which may or may not make things more accurate.
The usual model (based on Spice 3f5) for breakdown in diodes is influenced by 4 parameters:
- \$BV\$ - Reverse breakdown voltage in volts
- \$IBV\$ - Current at reverse breakdown voltage
- \$IS\$ - Saturation current
- \$N\$ - Emission coefficient / Ideality factor
From these parameters, Spice will attempt to calculate (iteratively) the "real" breakdown voltage \$XBV\$ to make the curve go through \$(BV, IBV)\$. Spice does this once during setup (or whenever the temperature has changed).
In reverse breakdown, the following equation is subsequently used:
$$i_D = -IS_{eff}\cdot e^{-\frac{XBV + v_D}{N\cdot U_T}}$$
\$IS_{eff}\$ is the reverse saturation current after applying temperature-dependent effects.
LTSpice claims in their documentation that
The other model available is the standard Berkeley SPICE semiconductor diode but extended to handle more detailed breakdown behavior and recombination current.
I believe that they point to the parameters:
- \$ISR\$ - Recombination current in amps
- \$NR\$ - \$ISR\$ injection coefficient
- \$IKF\$ - High-injection knee current
Unfortunately, I don't know much about these parameters.
APPENDIX
I did found some information about similar parameters here on HSpice.
Most diodes do not behave as ideal diodes. The parameters IK and IKR are
called high level injection parameters. They tend to limit the exponential current increase.
$$i_{D,eff} = \frac{i_D}{1 + \left( \frac{i_D}{IKR_{eff}} \right)^{1/2}}$$
$$i_D = IS_{eff}\cdot \left(e^{\frac{v_D}{N\cdot U_T}} - 1 \right) - IS_{eff}\left[e^{-\frac{v_D + XBV}{N\cdot U_T}} - 1\right]$$
Best Answer
The most likely culprit I see is the switch who doesn't use negative histeresys, as recommended by the manual. Positive and/or no histeresys makes it switch abruptly between the on/off resistances, while a negative histeresys will allow a smooth transition, thus allowing the solver pass the hops with elegance and dignity.
For the ideal diode you could try adding
epsilon=100m revepsilon=50m
, they set the quadratic region of the I-V curve's "knee". Also, the dynamic resistances you chose for the diode are quite far one from another (in orders of magnitude), which could pose problems. I think it's more than safe to chooseRon=1m Roff=1Meg
.