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.
Creating the current source with a table starting at 0V 0A probably clips your swing into the necessary negative direction, thus distorting the waveform and messing up the frequency response plot.
Giving it a wider range (-10V 1A, 10V 1A) gives it more headroom, but it could be clipping there too.
It might make more sense to use a BI
source and simply set the current to a formula depending on the voltage of your node, this will not cause any clipping. I recommend though to label the net, as the n###
automated node names can change.
Best Answer
You need to use 1e-16. It appears that gshunt is a conductance value and not a resistance value. I later found I did not need the parameter as I had mistakes in my schematic where I an inductor connected to the wrong point and I didn't have them coupled as a transformer.