Stepping with .step
An RC low pass run six times, stepping a capacitor and a .param.
.step cards step C1 over three values and the .param rval over two, so the circuit is run six times, with the rise time measured by .meas each time.
- v(out), run 1
- v(out), run 2
- v(out), run 3
- v(out), run 4
- v(out), run 5
- v(out), run 6
Output
Step 1 of 6: c1=500p rval=1k
Step 2 of 6: c1=1n rval=1k
Step 3 of 6: c1=2n rval=1k
Step 4 of 6: c1=500p rval=2k
Step 5 of 6: c1=1n rval=2k
Step 6 of 6: c1=2n rval=2k
Measurements for the steps:
step c1 rval risetime
1 500p 1k 1.09768e-06
2 1n 1k 2.19669e-06
3 2n 1k 4.39417e-06
4 500p 2k 2.19669e-06
5 1n 2k 4.39417e-06
6 2n 2k 8.78875e-06
Note: the steps' Transient Analysis scales differ, so their results are interpolated onto 421 even points
Stepped results are in plot tran7
Here are the vectors currently active:
Title: step_demo.cir - .step cards: an RC low pass stepped over c1 and a .param
Name: tran7 (Transient Analysis)
Date: Tue Sep 29 08:47:05 2026
c1 : cap-sweep, real, 3 long
in : voltage, real, 2526 long, scale = time, dims = [2,3,421]
out : voltage, real, 2526 long, scale = time, dims = [2,3,421]
risetime : time, real, 6 long, scale = c1, dims = [2,3]
rval : notype, real, 2 long
time : time, real, 421 long [default scale]
vin#branch : current, real, 2526 long, scale = time, dims = [2,3,421]
Step 1 of 6: c1=500p rval=1k
Step 2 of 6: c1=1n rval=1k
Step 3 of 6: c1=2n rval=1k
Step 4 of 6: c1=500p rval=2k
Step 5 of 6: c1=1n rval=2k
Step 6 of 6: c1=2n rval=2k
Measurements for the steps:
step c1 rval risetime
1 500p 1k 1.09768e-06
2 1n 1k 2.19669e-06
3 2n 1k 4.39417e-06
4 500p 2k 2.19669e-06
5 1n 2k 4.39417e-06
6 2n 2k 8.78875e-06
Note: the steps' Transient Analysis scales differ, so their results are interpolated onto 421 even points
Stepped results are in plot tran14
The circuit: examples/step_demo.cir
step_demo.cir - .step cards: an RC low pass stepped over c1 and a .param * A 1V pulse into an RC low pass, with r1 set by a .param .param rval=1k vin in 0 pulse(0 1 1u 1n 1n 50u 100u) r1 in out 'rval' c1 out 0 1n .tran 0.05u 20u * The 10%-90% rise time, 2.2*r1*c1 .meas tran risetime TRIG v(out) VAL=0.1 RISE=1 TARG v(out) VAL=0.9 RISE=1 * Step c1 (the first card varies fastest), then the .param .step c1 list 0.5n 1n 2n .step param rval list 1k 2k .control * Each run is now 6 runs, with a table of the rise times. The merged * plot's vectors have dimensions [rval][c1][time]. run display * A curve for each step plot v(out) * The rise time against c1, for each rval plot risetime * One step's curve: rval=2k (index 1), c1=1n (index 1) plot v(out)[1][1] .endc .end
Run it with spice step_demo.cir, or open it with File › Load netlist in the Qt window. The plots and output above were made by util/mkexamples.py, which runs the deck in batch mode. All examples