LTspice: Using the .STEP Command to Perform Repeated Analysis

There are two ways to examine a circuit in LTspice by changing the value for a particular parameter: you can either manually enter each value and then resimulate the circuit to view the response, or use the .step command to sweep across a range of values in a single simulation run.

The .step command causes an analysis to be repeatedly performed while stepping through a model parameter, global parameter or independent source. Here is an example waveform response of an RC circuit, for which the capacitance is stepped through three values.

To implement this in LTspice, perform the following steps:

  1. Define the component parameter with a variable by editing the component attribute (Ctrl–right-click on the component) and entering “{X}” for the Value, where “X” is a user defined variable name. The addition of the curly braces around the variable is important as it tells LTspice IV that “X” is a parameter.
  2. Add a .step command via a SPICE directive that specifies the steps for the parameter by a linear, logarithmic or list of values.
    Example A: “.step param X list .1u .2u .3u” steps the parameter X through each value listed.
    Example B: “.step param X .1u .3u .1u” steps the parameter X from 0.1u to 0.3u in 0.1u increments.

Once you run and view your simulation results in the waveform pane you can review the step information of a particular trace by attaching a cursor (click onto the trace label), using the up and down arrow keys to navigate the steps and then right-clicking onto the cursor to view the step information.

For more information on how to use the .step command to improve your understanding of a schematic, review the Help Topics in LTspice IV.



Gabino Alonso