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.
| Method | Choose it when | Tradeoff |
|---|---|---|
| default | You want ngspice's normal behavior. It currently uses trapezoidal integration. | The best starting point for most circuits. |
| trap | Select trapezoidal integration or compare a result with Gear. | Accurate and low damping, but stiff switching circuits can show numerical ringing. |
| gear | A 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.
| Preset | reltol | abstol | vntol | trtol | Use |
|---|---|---|---|---|---|
| normal | 1e-3 | 1e-12 A | 1e-6 V | 7 | Most analog, digital, and mixed circuits. |
| power | 5e-3 | 1e-8 A | 1e-5 V | 7 | Large-current switching circuits where very small absolute errors are not meaningful. |
| tight | 1e-4 | 1e-13 A | 1e-7 V | 3 | Small 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
- Begin with default and normal.
- For hard-switching power circuits with large currents, try power while keeping Trapezoidal. Confirm that important averages, ripple, losses, and switching edges remain stable.
- 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.
- 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
| Message | What it means | What to inspect |
|---|---|---|
| Bias Point did not converge | The initial DC solution failed before time integration. | Floating nodes, ideal-source conflicts, feedback or latch state, device values, and DC paths. |
| Transient timestep collapsed | The 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 matrix | The 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.