CONVERGENCE PROBLEMS

Overview

This final set of errors relates to what happens when SPICE itself fails to solve the circuit. Four messages indicate it, and each is prefixed in the log with [SPICE] to show that it came from the solver rather than from a model.

  • Matrix can't be decomposed as is. The circuit equations are ill formed and cannot even be set up for solution. Like the singular matrix case below, this normally points at a structural problem with the circuit rather than at a numerical one.
  • Matrix is singular. This is akin to having more unknowns than equations, and it usually relates to circuits which are mis-drawn, or in which some initial conditions need to be given in order to define the starting state.
  • Too many iterations without convergence. The circuit solution is unstable. Circuits with VSWITCH or CSWITCH primitives can create this condition easily, but any circuit whose transfer function is discontinuous can give SPICE serious problems. The same condition is named Iteration limit reached in the solver's own list of error codes, so you may see that wording quoted elsewhere.
  • Timestep too small. The circuit has switched in such a way that advancing the time even by very small amounts, typically 1E-18s, still does not produce an acceptably small change in circuit voltages.

A singular matrix is very often preceded by a lower case warning that names the nodes concerned, and that warning is the one to act on: singular matrix: check nodes <net> and <net>., or singular matrix: check node <net>. where only one node is implicated. The node names in it are links, so you can go straight to the offending part of the schematic. Look also for No DC path to ground warnings earlier in the log, which frequently name the same circuitry.

Where the solver can identify what defeated it, a timestep message also carries the trouble spot as a link, either as a node or as a component. A message of the form "trouble with node" or "trouble with instance" is worth clicking before anything else.

A timestep failure is often caused by a badly designed model, or by not supplying sufficient parameters to a diode or transistor model. In particular, if the junction capacitance values are not chosen correctly, these devices will exhibit zero switching times, which can lead directly to this error message.

Common Causes

Most convergence errors are due to badly drawn circuits or incorrect models. Time after time we have had circuits sent in that will not simulate, only to find that something is not connected. Please check the simulation log for clues, and re-check your circuit, before jumping to the conclusion that PROSPICE is at fault.

Where third party SPICE or VSM models have been used, we cannot spend time debugging them unless you can supply a simple circuit demonstrating the problem.

Beware also of using third party SPICE models which use features not supported in standard SPICE 2 or SPICE 3. Models developed for PSPICE can include all manner of elements and syntax constructs that are not standard SPICE.

Oscillators cause special problems because the initial solution for the operating point will fail. After all, an oscillator has no steady state. Use IC, NS or OFF properties to define a starting state, as discussed under Initial Conditions.

GMIN Stepping

Before reporting a failure to find an operating point, the simulator tries a technique called GMIN stepping. A large value of GMIN is used to find an initial solution, making the circuit behave more like a plain network of resistors, and the value is then ramped back down to its proper setting in stages so that accuracy is restored. The number of stages is set by GMINSTEPS. Progress is reported in the log, and a stage that fails reports:

Gmin step [<n> of <n>] failed: GMIN=<value>

Proteus extends the technique to the transient analysis as well, which standard SPICE does not do. Where a transient run runs into difficulty part way through, GMIN is raised and ramped back in exactly the same way, without abandoning the run. This is reported as:

transient GMIN stepping at time=<time>

and, when it succeeds, as:

transient GMIN stepping completed at time=<time>

The largest value the transient technique is allowed to reach is set by TRANGMIN, which defaults to 1E-9. Seeing these messages in a log is not in itself a problem, but a run that reports them repeatedly is a run whose results deserve a sceptical eye.

Tactics to Try

If the problem really is numerical convergence, you can try the tactics below. All of them are simulator options, and they can be set for one design or for all of them.

Setting Simulator Options

Simulator Options Reference

  • Increase the value of GMIN. This is a minimum conductance applied across reverse biased semiconductor junctions, and higher values make the circuit look more and more like a network of resistors, which will always solve. That is at the expense of accuracy. The default is 1E-12, and values above 1E-9 will give fairly meaningless results.
  • Increase the value of ABSTOL and/or RELTOL. These control the accuracy required before the solution is deemed to have converged. ABSTOL is an absolute current tolerance and defaults to 1e-12; RELTOL is a relative tolerance and defaults to 1e-3. The larger you make them, the less accurate the results will actually be.
  • If the circuit uses operational amplifiers, try the ideal amplifier model in place of the specific device type, by setting MODFILE=OA_IDEAL on the part. OA_IDEAL is one of the supplied amplifier models and it is far easier to solve. If the circuit then simulates, you have learned that the difficulty lies in the device model rather than in the circuit.
  • Lower the value of TRTOL. This is the factor by which the simulator overestimates its own local truncation error when it chooses the next timestep, and it defaults to 7. Reducing it makes that estimate less generous, so smaller timesteps are taken and the simulator is less likely to lose a convergent solution, at the expense of longer run times. It only helps where the simulation has failed part way through a transient analysis.

Reducing TRTOL is also the remedy for a different symptom: a simulation that completes but whose plotted traces look spiky, or contain mathematical noise. This often manifests itself as oscillation of a value after a rapid level transition. Nothing has failed in that case, but the timesteps were too coarse to follow the waveform.

The Numerical Convergence diagnostic channel reports the solver's own progress, and raising it is the way to see what happened before a failure. See Controlling What the Log Records.

See Also:

The Simulation Log

Simulation Errors

Ground and Power Rails

Initial Conditions

When a SPICE Model Will Not Simulate