Netlist sourcing and options for the Ngspice executable underlying pingspice.

The OPTIONS dict specifies Ngspice options that are set before any commands are run. A comment at the PICAXE forum provides some useful insight::

   If the [convergence] problem really is numerical convergence, you can
   try the following tactics:
   Increase the value of GMIN. This is a leakage resistance for reverse
   biased semiconductor junctions, and lower values make the circuit
   look more and more like a network of resistors (which will always
   solve). But this is at the expense of accuracy. The default is
   1E-12; values above 1E-9 will give fairly meaningless results. Note
   in any case, that SPICE3F5 will try what is called GMIN stepping if
   at first the circuit will not converge. This means that a large GMIN
   is used to find an initial solution, and the value is then ramped
   back to its original value in order to maintain accuracy.
   Increase the value of ABSTOL and/or RELTOL. These values control the
   accuracy that is required for the simulation to be deemed to have
   converged. However, the larger you make these tolerances, the less
   accurate the results will actually be.
   If the circuit uses op-amps, try specifying MODFILE=OA_IDEAL instead
   of a specific device type - this model is much easier to simulate.
   Lower the value of TRTOL. This will make SPICE use smaller timesteps
   so it will be less likely to ‘lose’ a convergent solution, but at
   the expense of longer run times. This will only work if the
   simulation has failed part way through a transient analysis.
   You should also try reducing TRTOL if plotted traces look ‘spiky’,
   or contain mathematical noise. This often manifests itself as
   oscillation of a value after a rapid level transition.

Charles Hymowitz wrote, "You can set ABSTOL and VNTOL about eight orders of magnitude below the average voltage and current." Because an important aspect of pingspice is making Ngspice usable with power MOSFETs and switching power supplies, it must support an average voltage and current much higher than in the integrated circuits for which SPICE was originally designed. Consider a drain voltage of 100V; eight orders of magnitude lower than that is 1e-6. So we should consider ourselves lucky to get away with an ABSTOL of anything less than 1e-9.

Class OptionParser I parse text lines in the CONTROL section of an Ngspice netlist.
Class Sourcer I handle netlist sourcing.
API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.