CirSpice

Plots and measuring

Reading results: traces, cursors, probes, measurements and export.

User guide / 7. Plots and measuring

Traces and plot groups

After a run, the plot shows the expressions the analysis lists (see What to plot). Click a trace's chip to show or hide it; right-click it to change its colour or move it to another plot. Add Plot Group stacks another plot on the same x axis, and the cross on a plot's legend removes it. An AC run shows a plain voltage or current as dB or phase against a log frequency axis.

Plot expressions

An expression to plot can name:

WriteMeaning
T, FTime in a transient, frequency in an AC run.
v(OUT), v(A,B)A node's voltage to ground, or the voltage from one node to another. Name nodes by their labels.
i(R1)The current through a part.
IC(Q1), VCE(Q1), VB(Q1)The current into one lead of a device, the voltage between two of its leads, or one lead's voltage. Lead letters follow the device: C, B, E for a bipolar transistor; D, G, S, B for a MOSFET; D, G, S for a JFET.
PD(R1), PS(C1), PG(V1)Power dissipated in a resistor, stored in a capacitor, or generated by a source. Other parts' power is not available yet, and says so.
PDT, PST, PGTThe whole circuit's power dissipated, stored and generated.
Z(R1)A two-pin part's impedance.
B(L1), H(L1)Flux density and field of a winding on a magnetic core.

These combine with + - * /, ^ for powers, comparisons, AND, OR, MOD and DIV, and the functions SIN, COS, EXP, ABS, TANH, LN, LOG, LOG10, SQRT, ATAN, U, MIN, MAX, POW, LIMIT, IF and NOT. Some functions work on the whole curve:

  • DB, MAG, PH, RE and IM: an AC quantity in decibels, its magnitude, its phase in degrees, its real or imaginary part.
  • RMS(x): the running RMS value of x from the start of a transient run.
  • DD(x): the derivative of x, point by point, against time, frequency or the swept value.
  • DEL(x): the change in x from each point to the next.
  • HARM(x): the harmonic content of x, against frequency. It plots only as an expression of its own, not inside another.

A name the circuit defines with .DEFINE can be used too.

Examples

v(OUT)/v(IN)            voltage gain in time
db(v(OUT)/v(IN))        gain in dB, in an AC run
ph(v(OUT))              phase of the output, in degrees
v(OUT)*i(RLOAD)         power into the load
rms(v(OUT))             RMS of the output from the start of the run
dd(v(OUT))              slope of the output, in volts per second

An expression that cannot be plotted says why under it in the Analysis Limits, after a run.

Zoom and scroll

  • Drag across a plot to zoom to that span; drag a box to zoom the y axis as well.
  • The mouse wheel zooms around the pointer. On a trackpad, pinch or swipe up and down to zoom, and swipe sideways to scroll.
  • Double-click, or Fit, shows the whole run. Auto Y undoes a y zoom.
  • Hovering shows the x and y under the pointer.

Cursors

Click to place cursor A, and shift-click to place cursor B. The readout gives each cursor's x, every trace's value there, the difference B minus A, and for a transient 1/(B-A), the frequency of one period between them.

Probe the schematic

Turn on Probe (⌥⌘P), then click the schematic: a wire plots its voltage, and a part its current or power. Run the analysis first: probing needs a result to plot.

Node voltages on the schematic

Node Voltages in the toolbar writes each net's value from the last run on the schematic. With Analysis > Dynamic DC on, the values are the operating point, computed again after every edit.

Measure

Measure (⇧⌘M) adds a measurement on a trace: its peak, high or low value, rise or fall time, the x where it crosses a level, its width, period or frequency, and more. Each takes the numbers it needs, is measured again on every run, and on a stepped run gives one value per step. A measurement that has no answer on the curve says why.

Example

On the RC step in Capacitor, add Rise_Time on v(OUT) with N 1, Low 0.1 and High 0.9: the time the first rising edge takes from 0.1 V to 0.9 V. It gives about 219.7 us, and is measured again whenever you run, so changing the resistor updates it at once.

Each plotted expression also has an f(x) menu that wraps it in DB, MAG, PH (phase), RE or IM (real or imaginary part), or DEL (the change from each point to the next).

Export

File > Export Plot saves the plot as you see it, with its groups, colours, ranges and cursors, as a PNG image (at twice the screen's resolution) or an SVG drawing; or its data as a CSV file, one column per trace, which spreadsheet apps open directly.

What is kept

When you save, CirSpice remembers each analysis's plot groups, colours, ranges and cursors in its own file next to the circuit, and shows them again the next time you open it. See Editing and saving.