Integration Methods

LTspice offers three different integration methods in the control panel. For the same accuracy, gear integration requires more time steps and is therefore generally slower than trap integration. It also imposes some artifical numerical dampening on the circuit, which can make unstable circuits look stable in simulation. Thus, trap integration is both faster and more accurate than gear integration. However, it can give rise to a numerical artifact called trap ringing, where the integrated discrete time step solution oscillates time step to time step about the true continuous-time behavior. The amplitude of this oscillation increases with increasing time step and can easily conceal important details of a waveform. That is why LTspice has an additional method called modified trap, which actually is identical to trap, except for an additional post-processing that eliminates the oscillation and which works like this:

Using three points at a time, LTspice calculates an upper interpolating line and a lower interpolating line and then saves the average of these two lines instead of the original result. As long as a waveform exhibits trap ringing, this procedure restore the true continuous-time solution. However, note that waveforms without trap ringing are made slightly less accurate, as can be seen in the following picture:

In this example, the average between the lower interpolator and the original data point is smaller than the original data point, which actually is the correct result. This leads to a small error in the saved value, which increases with increasing time step. If this error is unacceptable, use trap integration instead. In the majority of cases, the elimination of trap ringing far outweighs the small loss of accuracy.

Note that modified trap does not apply its post-processing to all waveforms, because certain nodes, like the output of an independent source, will never exhibit trap ringing and therefore need no correction. This can lead to surprising results, e.g. in this example circuit:

With modified trap, plotting the voltage V(a,b) across R1 may not produce the expected result, because LTspice saves the original V(a) but the post-processed V(b):

Note though that this is an example as extreme as the ratio of R1 and R2.