Undocumented LTSPICE features-solving some of convergence problems using backward Euler integration method.

LTSPICE is surprisingly flexible simulator but some of important options are not described in documentation. One of them is additional method of integration that you can use to address convergence problems. This method is called backward Euler.

Per comments of Mike Engelhardt, LTSPICE author:

“Where mod-trap, trap, and Gear are all implemented as 2nd order methods in SPICE programs, backward Euler is the 1st order method. You can use this method by adding the SPICE directive “.options maxord=1” to your simulation.

Backward Euler is as stable if not more so than Gear, but is the slowest and least accurate of all methods.”

Some other Mike’s comments related to integration methods, that I was able to find on one of EE forums:

“Gear, compared to trap, has the advantage that it is numerically more stable, but less accurate. In principle, it’s better defined because Steven Gear even specifies when you change integration order and timestep size.

PSpice is hard-wired to use Gear(well, the docs say it a proprietary algorithm, but it acts like Gear.) The inaccuracy of Gear comes from the fact it dampens the circuit. The amount of dampening decreases with decreasing step size.

Trapezoidal is faster and usually much more accurate. Occasionally it’s not as numerically stable, especially when running non-physical circuits described with macro-models. It has the disadvantage that it can ring as a simulation artifact. This can be disconcerting to novice SPICE users.

Most SPICE programs have some form of Trapezoidal integration as the default. There’s fair bit of leeway in trap implementations, so I call them all affectionately cowboy integration. Modified-trap is a proprietary algorithm that has the speed and accuracy of trap but precisely cancels traditional trap ringing. It is the most accurate method I know of.

If you’re using LTspice, use the default of modified trap. Use trap and Gear only as diagnostics. Gear will let you duplicate some PSpice simulations. For example, if LTspice says a circuit is unstable but PSpice says it’s stable, you can switch LTspice to use basically the same integration method of PSpice to duplicate it’s erroneous results for diagnostic purposes.

Switch to pure trap instead of Modified-trap if you want to see if your circuit is trap ringing. If the trap ringing that Modified-trap cancels is spread over several circuit nodes, then the cancellation might not work well. Using pure trap lets you investigate potential simulation artifacts.”

I have very positive personal experience with LTSPICE backward Euler integration method and have not noticed slow operation while using directive “.options maxord=1“. It is probably due to the fact that when other methods don’t work, this one allows you to get simulation results.

Comments

One Response to Undocumented LTSPICE features-solving some of convergence problems using backward Euler integration method.