# Transient Analysis

In this topic:

## What Causes Non-convergence?

There are a number of reasons for convergence failure in transient analysis but most have their root in one of the following:

1. Numerical noise (also known as round-off error) is preventing the required accuracy from being reached. SIMetrix has a range of iteration modes that allow the reduction of numerical noise at the expense of simulation run time. See Numerical Noise and Iteration Modes
2. The circuit contains discontinuities. This is where a model or a circuit construction can switch abruptly from one state to another with no defined time to do so. This behaviour violates one of the conditions required for the iteration algorithm to guarantee convergence. It can also defeat the algorithm used to estimate the accuracy of modelling reactive components. Discontinuities can be solved either by introducing a smooth behaviour or by defining a finite time to switch states

3. Instability. This is where the circuit has an unbounded instability and thus has no finite solution. This can be caused, for example, by positive feedback loops or unrealisable networks.

4. Overload. The solution is beyond the numerical range available. A trivial example of this is a PN junction biased by a large voltage. Without any series resistance, the voltage does not need to be very high for the current in the device to exceed the range of the machine.

## Numerical Noise and Iteration Modes

### Numerical Noise

Numerical noise is one of the major causes of non-convergence in transient analysis. Numerical noise is the noise induced as a result of uncertainly in a calculation due to the limited precision of the arithmetic (sometimes referred to as round-off error). Numerical noise is similar in concept to quantization noise that is prevalent in data converters. Numerical noise increases as the time step reduces due to the behaviour of reactive components and can reach levels that exceed the tolerance parameters that determine when convergence has been reached.

SIMetrix uses two strategies to reduce numerical noise and these are controlled by the iteration mode:
1. Use the advanced iteration algorithm. This employ a variation in the iterative equation that lowers the error terms for most practical circuits. It benefits circuits with high voltages or high-side sections. The advanced iteration algorithm has only a minor effect on performance.
2. Use a higher calculation precision. Most numerical software including most analog simulators use double precision which is about 16 decimal digits. SIMetrix has options to use extended precision, which is about 19 decimal digits, and quad precision which is about 34 decimal digits.

### Iteration Modes

SIMetrix offers 8 iteration modes that provide control over the trade-off between numerical noise and simulation run time. The default mode 1 is the fastest while mode 8 more or less eliminates numerical noise albeit with a significant performance penalty.

The iteration mode is set by the CONV option setting:

.OPTIONS CONV=<mode>

Where <mode> is an integer from 0 to 8 as described in the table below.

 Mode Typical numerical Typical simulation Advanced Precision 0/1 1 x 1x No Double/Extended 2 ÷ 100 + 5% Yes Double/Extended 3 ÷ 1000 + 10%-25% No Extended 4 ÷ 10000 + 10%-30% Yes Extended 5 ÷ 1e16 2x to 8x No Extended/Quad 6 ÷ 1e18 2x to 8x Yes Extended/Quad 7 ÷ 1e16 4x to 10x No Quad 8 ÷ 1e18 4x to 10x Yes Quad

The value in the Typical numerical noise factor column is the typical reduction in numerical noise compared to mode 0/1. For example, for mode 4 the numerical noise is typically reduced by a factor of 10000 - so the noise will typically be 10000 times lower. Be aware that these are typical values and can vary widely between different circuits and operating conditions.

The above simulation run time factors are typical when using 4 cores. The penalty for the quad precision modes is higher with single core operation.

CONV mode 4 is probably the most useful. It is very effective at solving convergence problems with difficult circuits and affects performance only a little - typically slowing down the simulation by about 25%.

Modes 2, 4, 6 and 8 enable advanced iteration employ the advanced iteration algorithm. This uses a variation in the iterative equation that lowers the error terms for most practical circuits. Advanced iteration is mathematically identical to normal iteration and imposes only a marginal performance penalty.

As well as generally having lower numerical noise, advanced iteration has more dependable error detection. In rare situations, normal iteration can converge on a solution that is inaccurate due to round-off error. Usually round-off error causes numerical noise as explained above but in linear circuits (or linear portions of non-linear circuits) round-off error can be static which means the convergence detection algorithm incorrectly detects an inaccurate result. This effect does not occur with advanced iteration. This can mean that on some occasions advanced iteration fails when normal iteration succeeds.

### Convergence Mode GUI

Modes 0, 2, 4, 6 and 8 may be selected through the convergence GUI. See Users Manual / Analysis Modes / Convergence / Convergence Options / Iteration Mode

CONV modes 5 to 8 use Quad precision. Quad precision uses 128-bit values and enjoys a decimal resolution of about 34 digits. No current windows-compatible microprocessor implements quad precision arithmetic in hardware and consequently quad precision calculations are software implemented.

All quad precision modes enjoy very low levels of numerical noise and more or less eliminate this as a source of transient analysis convergence failure. However the performance penalty can be severe. CONV mode 6 for example, will slow down the simulation typically by about 3x although it can be slower.

Quad precision is not often needed to make a circuit using normal tolerances run; there is usually another way to resolve a convergence problem which doesn't impose a performance penalty. However, if one of these setting does fix the problem, it is likely to be a reliable fix, and the increased run time may be satisfactory trade-off.

Quad precision is also useful for diagnosing convergence problems caused by other factors. With the lower precision modes, numerical noise can often mask the true cause of a convergence problem. With quad precision the real cause is more easily seen.

Of the four quad precision modes, mode 6 is likely to the best choice. Mode 6 also makes use of extended precision where possible to improve performance and is consequently faster than mode 8 which uses quad precision exclusively.

Note that the Simkit devices and BSIM4 versions 4.3 and earlier do not support quad precision. Although circuits containing these devices will run in quad precision mode, there will only be a small improvement in convergence. Quad precision is also not available with SIMetrix Elements (free version).

It should be noted that the calculation precision does not usually affect the simulation accuracy. This is determined by the tolerance settings especially RELTOL. However, using tighter tolerance parameters increases the sensitivity of the simulator to the effects of numerical noise and so can, and often does, lead to convergence failure. So, using a higher precision mode will allow tighter values of the tolerance parameters to be used.

## Fix and Improving Transient Convergence

1. Select menu Simulator > Convergence Failure Report.... This will display a report providing information on the cause of failure. For more details of this report, see User's Manual/Analysis Modes/Convergence/Convergence Failure Report

2. As with DC operating point, check your circuit. In particular, check that you are not doing anything which might cause numerical difficulties such as forward biasing a zero resistance PN junction with a large zero source impedance voltage source.
3. Do anything that will prevent small time steps being needed. Gross non-linearities, regenerative loops and high gain loops all require small time-steps if not well damped. It may be that you have left out damping components to simplify the circuit and speed the simulation.
4. Try a higher iteration mode. At the netlist level add .OPTIONS conv=<value> where <value> is an integer between 2 and 8. The higher the value the higher the precision but the slower the simulation run time. Modes 5 to 8 use quad precision and have a significant performance penalty. See Iteration Modes for more details. If running from the schematic editor, some modes may be selected using menu Simulator > Convergence Options...
5. Avoid over-idealising. A common misconception is that simplifying a circuit by removing reactive components such as capacitors will speed up a simulation and make it easier to converge. Capacitors have a number of stabilising effects on simulation and are usually beneficial.
6. Avoid using unrealistically large capacitors or inductors and unrealistically small resistors if at all possible. You should especially avoid such components if non-grounded.
7. If you have some large capacitors in your circuit, try adding a small amount of ESR using the built-in capacitor ESR parameter rather than a separate resistor.
8. If all else fails you can try relaxing some of the tolerances. If your circuit does not have any small (sub-$\mu$A) currents then set ABSTOL to 1e-9 or 1e-6. You can also increase VNTOL (default 1e-6) to say 1e-3 if your circuit only has large voltages. Increasing RELTOL is the very last thing you should try. In our experience, increasing RELTOL beyond its default value (0.001) is rarely a reliable solution and can make matters worse.
9. If you have current maintenance, contact technical support providing us with your full schematic and any models you are using. We can fix most convergence problems.