next up previous contents index
Next: .ac Line Up: WRspice Input Format Previous: Subcircuit/Model Cache   Contents   Index

Analysis Specification

WRspice provides the analysis capabilities tabulated below. Monte Carlo and operating range analysis (described in Chpt. 5) require a special input file format, while other types of analysis can be specified in a standard input deck.

Analyses will pause if WRspice receives an interrupt signal, i.e., the user types Ctrl-C while WRspice has the keyboard focus. The resume command can be used to resume the analysis.

By default, the maximum size of the data produced by an analysis run is limited to 256Mb. This can be changed by setting the variable maxdata to the desired value in Kb, using the set command or the Simulation Options tool from the Tools menu of the Tool Control window. In transient analysis, if the steptype is not set to ``nousertp", the run will abort at the beginning if the memory would exceed the limit. Otherwise, the run will end when the limit is reached.

The table below lists the basic analysis types and input file keyword.

.ac AC Small-Signal Analysis
.dc DC Analysis
.disto Small-Signal Distortion Analysis
.noise Small-Signal Noise Analysis
.op Operating Point
.pz Pole-Zero Analysis
.sens DC or Small-Signal AC Sensitivity Analysis
.tf DC or Small-Signal AC Transfer Function Analysis
.tran Transient Analysis

An operating point analysis is performed implicitly before other types of analysis, with the exception of transient analysis when the uic keyword is given. This solves for the initial dc operating point of the circuit. The circuit is linearized at this point for AC/small signal analysis (including pole-zero, transfer function, and noise analysis). It is the starting point for dc and transient analysis.

WRspice has an exclusive multi-dc analysis feature. This allows ac, noise, transfer function, sensitivity, and transient analyses to have an additional dc sweep specification, resulting in the analysis being performed at each dc operating point, producing a multi-dimensional output plot.

In WRspice, any circuit parameter can be swept. This is far more powerful than the original SPICE dc sweep, which only allowed sweeping of source outputs.

For example, a regular SPICE dc sweep would have a form like:

.ac dec 10 1Hz 1Khz dc v1 0 2 .1 v2 4.5 5.5 .25

This will perform an ac analysis with the dc sources v1 and v2 stepped through the respective ranges. The resulting output vectors will have dimensions [5,21,61], as can be seen with the display command interactively. This represents 61 points of frequency data at 21 v1 values at 5 v2 values. Typing ``plot v(1)'' (for example) would plot all 21*5 analyses on the same scale (you probably don't want to do this). One can also type (as examples) ``plot v(1)[1]'' to plot the results for v2 = 4.75, or ``plot v(1)[0][1]'' for v2 = 4.5, v1 = .1, etc. Range specifications also work, for example ``plot v(1)[2][0,2]'' plots the values for v2 = 5.0, v1 = 0.0, 0.1, 0.2.

WRspice also allows forms like

.ac dec 10 1Hz 1Khz dc R1[res] 800 1200 100 R5[res] 10 20 1
This will perform the ac analysis as the values of two resistors are swept.

Warning: The memory space required to hold the plot data can grow quite large, so be reasonable.

Multi-threading (see 1.4) will be used for chained analysis if the loopthrds variable is set to a positive value. This can parallelize the runs on computers with multiple cores or CPUs, speeding evaluation.

next up previous contents index
Next: .ac Line Up: WRspice Input Format Previous: Subcircuit/Model Cache   Contents   Index
Stephen R. Whiteley 2017-02-22