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.
| Field | What it sets |
|---|---|
| Maximum Run Time | How 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 Step | The 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 Points | How many points the results are printed at. |
| Temperature (C) | The temperature the circuit runs at; 27 when the file sets none. |
| State Variables | Where 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 Point | On: the run starts from the circuit's DC operating point. Off: it starts from zero. |
| Operating Point Only | Computes the operating point and no run in time. |
| Auto Scale Ranges | Micro-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.
| Field | What it sets |
|---|---|
| Frequency Range method | Log (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 Points | How many frequencies are computed. |
| Temperature (C) | As for Transient. |
| State Variables | As for Transient. |
| Operating Point | On: 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 Ranges | Micro-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.
| Field | What it sets |
|---|---|
| Variable 1 Method | Linear 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 Method | None, 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 Points | How many points the results are printed at. |
| Auto Scale Ranges | Micro-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:
- Transient: the RC step (63.2% after one time constant, a 10 to 90% rise of 219.7 us), the half-wave rectifier and the inverting amplifier.
- AC: the RC low-pass (−3.01 dB and −45 degrees at 1591.5 Hz) and the second-order Laplace filter.
- DC with one variable: the JFET's drain current against gate voltage. With two: the NPN's output curves, one curve per base current.
- Temperature: the divider with a temperature coefficient, run at 127 C.
A DC sweep, step by step
- Place a Voltage Source named
V1with the valueDC 0, a resistor of1kfrom it to a node labelledA, and a diode fromAto ground, with a model such as.MODEL DSIG D (IS=1e-14 N=1.8)on the text page. - Pick DC. Set Variable 1 Name to
V1and Variable 1 Range to5, 0, 0.01: from 0 to 5 V in 10 mV steps. Leave Variable 2 Method at None. - Add the expressions
v(A)andi(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.
| Setting | What it changes | For |
|---|---|---|
| Default | Nothing: the standard tolerances and iteration limits. | Going back after trying another. |
| Power stage | RELTOL 3e-3, ABSTOL 1e-9, VNTOL 1e-4, ITL1 500, ITL4 100. | Switching and power circuits, with amperes and volts. |
| High impedance | ABSTOL 1e-15, VNTOL 1e-7, CHGTOL 1e-16, GMIN 1e-15, ITL1 500. | Nanoamp currents and gigaohm resistances. |
| Start from zero | Turns 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
1Mfor a million.Mis milli: write1MEG. A run time of1Mis one millisecond.- Ranges in the wrong order. Micro-Cap writes the end of a range first:
fmax, fminfor AC,end, start, stepfor 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
ACvalue, 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.