Documentation

Simulation solvers and tolerances

Choose ngspice integration and tolerance settings for the circuit you need to analyze.

SPICE Circuit settings

The Method, Accuracy, andAdvanced tolerances controls apply to SPICE Circuit. They configure the selected ngspice analysis. A transient analysis'sInitial conditions control selects the UIC option.

For a SPICE Circuit run, ngspice normally solves the circuit's DC operating point before a transient run advances time. It then integrates capacitors and inductors, solves the circuit at each time point, and adapts its internal timestep to control error.

A solver setting can improve numerical behavior, but it cannot repair a floating node, conflicting ideal sources, an invalid model, or an impossible initial state.

Choose an integration method

Select Simulate > Setup, choose the analysis in Analyses, and set Method in its Solver section. Choose Accuracy for a preset or open Advanced tolerances to edit individual values.

MethodChoose it whenTradeoff
defaultYou want ngspice's normal behavior. It currently uses trapezoidal integration.The best starting point for most circuits.
trapSelect trapezoidal integration or compare a result with Gear.Accurate and low damping, but stiff switching circuits can show numerical ringing.
gearA hard-switching or stiff circuit shows timestep collapse or suspicious trapezoidal ringing.Adds numerical damping. It can suppress genuine high-frequency ringing, so compare important waveforms with Trapezoidal.

Bias-point failures happen before transient integration. Changing Trapezoidal to Gear does not address a DC operating-point failure.

Choose an accuracy preset

The Accuracy control sets four related tolerances for SPICE Circuit. The Advanced group shows their effective values and lets you override one value while keeping the other preset values.

PresetreltolabstolvntoltrtolUse
normal1e-31e-12 A1e-6 V7Most analog, digital, and mixed circuits.
power5e-31e-8 A1e-5 V7Large-current switching circuits where very small absolute errors are not meaningful.
tight1e-41e-13 A1e-7 V3Small signals or precision comparisons after the circuit already runs reliably.
  • reltol is the relative voltage and current convergence tolerance. Lower values demand closer agreement.
  • abstol is the absolute current tolerance. It dominates near zero current.
  • vntol is the absolute voltage tolerance. It dominates near zero volts.
  • trtol scales transient truncation-error control. Lower values generally make timestep control more conservative.

Tighter tolerances can require more iterations and smaller timesteps, and may cause convergence failures around model discontinuities. The Power preset uses looser tolerances for large-signal switching. Compare the waveforms and measurements you need before accepting a tolerance change.

Transient timing controls

  • step is the requested transient output step.
  • max caps the adaptive internal timestep. Use it when switching edges or high-frequency behavior need more time resolution.
  • from omits earlier results from the saved output.
  • Initial conditions skips the normal operating-point initialization for a transient run. It is an initial-condition choice, not a general convergence repair.

A practical selection guide

  1. Begin with default and normal.
  2. For hard-switching power circuits with large currents, try power while keeping Trapezoidal. Confirm that important averages, ripple, losses, and switching edges remain stable.
  3. If a transient timestep collapses at a switching event, compare gear with Trapezoidal. Add realistic rise times, gate resistance, ESR, winding resistance, leakage, and switch impedance before relying on numerical damping.
  4. Use tight for precision work only after the circuit is stable. Reduce max when time resolution, rather than convergence tolerance, limits the result.

Read a convergence failure

MessageWhat it meansWhat to inspect
Bias Point did not convergeThe initial DC solution failed before time integration.Floating nodes, ideal-source conflicts, feedback or latch state, device values, and DC paths.
Transient timestep collapsedThe adaptive timestep became too small at a particular time.The named device or node, abrupt transitions, extreme impedance ratios, missing parasitics, and the event at the reported time.
Singular matrixThe circuit equations are not uniquely solvable.Missing DC paths, unconnected nodes, and loops or cutsets made entirely from ideal elements.

OhmSpice preserves useful SPICE clues such as failed source stepping, failed gmin stepping, the failure time, and named nodes or devices. After changing solver settings, check the resulting waveforms; a completed run does not prove the circuit or model is correct.

Further reading

For the equations and full option reference, see the official ngspice manual.