CirSpice

Analyses

What each analysis does, and the fields of its Analysis Limits.

User guide / 3. Analyses

CirSpice runs three analyses: Transient, AC and DC. The menus also list Operating Point, for files that have one; see Operating Point below. Pick one from the analysis menu in the toolbar or from the Analysis menu (⌥⌘1 to ⌥⌘4). Its Analysis Limits open on the right of the window; F9 opens them again later. A circuit keeps the limits Micro-Cap saved with it, and CirSpice saves your changes back into the .CIR file.

In a field, type a value and press Return. Values take suffixes, as in 10m or 1MEG (see Values and expressions). A value the field cannot take is refused with the reason, and the field keeps its old value. Every change can be undone.

A choice that is shown but cannot be picked yet says why when you point at it.

Transient

Simulates the circuit over time, as an oscilloscope would show it.

FieldWhat it sets
Maximum Run TimeHow long the simulation runs, in seconds. A circuit with no run time saved shows this field empty, and runs for 1 microsecond.
Output Start Time (tstart)The time from which results are kept. The simulation still starts at 0.
Maximum Time StepThe largest step the simulator may take. Empty means the run time divided by 50. A smaller step gives smoother curves and a slower run.
Number of PointsHow many points the results are printed at.
Temperature (C)The temperature the circuit runs at; 27 when the file sets none.
State VariablesWhere the run starts. CirSpice starts every run either from zero or from the operating point (below); other starting states are listed but cannot be picked yet.
Operating PointOn: the run starts from the circuit's DC operating point. Off: it starts from zero.
Operating Point OnlyComputes the operating point and no run in time.
Auto Scale RangesMicro-Cap's plot setting, kept in the file.

AC

Finds the circuit's small-signal response over a range of frequencies, around its operating point. Sources take their size from their AC value.

FieldWhat it sets
Frequency Range methodLog (points spread evenly per decade) or Linear. Auto stays Auto in a file that has it. A list of frequencies does not run in CirSpice yet.
Frequency Range (fmax, fmin)The highest and lowest frequencies, highest first, as Micro-Cap writes them: 10MEG, 10.
Number of PointsHow many frequencies are computed.
Temperature (C)As for Transient.
State VariablesAs for Transient.
Operating PointOn: the response is computed around the circuit's DC operating point. Off: around zero volts, which CirSpice accepts only for circuits where that is well defined, and otherwise says why.
Auto Scale RangesMicro-Cap's plot setting, kept in the file.

The plot shows a plain voltage or current as its magnitude in dB or its phase, against a log frequency axis.

DC

Sweeps a source's DC value, or the temperature, and plots the circuit's DC response at each step, as a curve tracer would. A second variable makes one curve per value of it.

FieldWhat it sets
Variable 1 MethodLinear steps, or Auto in a file that has it. Log and List sweeps are not available yet.
Variable 1 Name (source or TEMP)The name of the source to sweep, such as V1, or TEMP to sweep the temperature.
Variable 1 Range (end, start, step)Where the sweep ends and starts, and its step, end first: 5, 0, 0.1.
Variable 2 MethodNone, or Linear for a second, outer sweep.
Variable 2 Name (source)The source the outer sweep steps.
Variable 2 Range (end, start, step)As for variable 1.
Temperature (C)As for Transient, when the sweep is not of temperature.
Number of PointsHow many points the results are printed at.
Auto Scale RangesMicro-Cap's plot setting, kept in the file.

Operating Point

The DC bias: every node's voltage with the sources at their DC values, capacitors open and inductors shorted. A file's own Operating Point analysis does not run on the Mac yet. Two ways give the same values: Analysis > Dynamic DC (below), or a Transient with Operating Point Only checked, then Node Voltages.

After any run, Node Voltages in the toolbar writes each net's value from that run on the schematic. Analysis > Dynamic DC goes one step further: it computes the operating point and shows it on the schematic, then computes it again after every edit while it stays on, so you can change a resistor and watch the bias move.

Worked examples

Each of these is set out in full, with the numbers to expect, in the entry of the part it is about:

A DC sweep, step by step

  1. Place a Voltage Source named V1 with the value DC 0, a resistor of 1k from it to a node labelled A, and a diode from A to ground, with a model such as .MODEL DSIG D (IS=1e-14 N=1.8) on the text page.
  2. Pick DC. Set Variable 1 Name to V1 and Variable 1 Range to 5, 0, 0.01: from 0 to 5 V in 10 mV steps. Leave Variable 2 Method at None.
  3. Add the expressions v(A) and i(R1) (your resistor's name), and run.

The x axis is now V1's value, not time. The diode's voltage rises quickly at first, then bends over; past the knee, almost all of each extra volt appears across the resistor, so the current rises by about 1 mA per volt.

What to plot

Below the fields, the limits list the expressions to plot, such as v(out), i(R1) or v(a)-v(b). Type one and press Return to add it; each can be edited or removed. After a run, an expression that cannot be plotted says why under it. See Plots and measuring.

Stepped runs

When a circuit steps a value (runs the analysis once for each of several resistor values, say), CirSpice runs each step in turn and plots all the curves together, each labelled with its value, such as v(out), R1=2k. The Analysis Limits list the runs. Changing the stepping in CirSpice is not available yet.

When a run will not converge

When the simulator cannot find a solution, the Messages tab names the kind of failure and offers simulator settings to try, the one most likely to help first, each listing the options it changes. Apply and Run applies one as an edit you can undo and runs again; when you save, it is written into the circuit's .OPTIONS line, which Micro-Cap reads too.

SettingWhat it changesFor
DefaultNothing: the standard tolerances and iteration limits.Going back after trying another.
Power stageRELTOL 3e-3, ABSTOL 1e-9, VNTOL 1e-4, ITL1 500, ITL4 100.Switching and power circuits, with amperes and volts.
High impedanceABSTOL 1e-15, VNTOL 1e-7, CHGTOL 1e-16, GMIN 1e-15, ITL1 500.Nanoamp currents and gigaohm resistances.
Start from zeroTurns Operating Point off, so a transient starts with every node at 0 V.A transient whose operating point cannot be found.

Settings > Simulator has two limits that stop a run which is going nowhere: No progress halts a run that advances less than a set share in a set time (1% in 60 seconds unless you change it), and Run time limit halts any run longer than a set time (off unless you set it). A halted run keeps no points, and the Messages tab offers the same settings to try. Stop (⌘.) ends a run yourself.

Monte Carlo and worst case

When a circuit carries Micro-Cap's Monte Carlo options or a worst-case setup, Analysis > Tolerance (⌥⌘6) runs it, using the tolerances written on the parts and models (LOT and DEV).

  • Monte Carlo runs the analysis many times with values drawn within their tolerances, and measures each run with an expression, or for a curve a measurement such as High_Y. It shows the seed, each run's value, the mean, sigma, minimum and maximum, and a histogram. A new seed gives a new draw.
  • Worst case runs one of the circuit's worst-case setups and shows the nominal value, each tolerance's variation and sensitivity, and the combined results.

Cancel stops between runs.

Common mistakes

  • 1M for a million. M is milli: write 1MEG. A run time of 1M is one millisecond.
  • Ranges in the wrong order. Micro-Cap writes the end of a range first: fmax, fmin for AC, end, start, step for DC.
  • A step too large. A transient with sharp edges and no Maximum Time Step can look jagged: set a step well below the fastest edge.
  • No AC value on any source. An AC analysis needs at least one source with an AC value, or every response is zero. (Micro-Cap's own Sine and Pulse Sources count as 1 V in AC.)
  • A node with no path to ground. A node joined to the rest only through capacitors, or a loop of voltage sources and inductors, has no DC solution: the run fails with a singular matrix. Add a large resistor to ground, or a small one in the loop.