Wednesday, September 28, 2011

Parameter Sweeps in LTSpice - The .step Command

To step a parameter in LTSpice, simply place curly brackets around a variable name for the value you wish to step. We need to tell spice that we want to "step a parameter". To do this we us the "parm" syntax after the .step command. We need to tell the step command the parameter (variable) we want to step, the starting and ending value and the step increment.

Example: Let's say we want to step the value of a resistor from 10 to 100 ohms in 10 ohm steps. For the value of the resistor we use {R1}. Next, we use the ".step" spice directive followed by the step range and increment. We place the following directive on our schematic:

.step param R1 10 100 10

Here is an example stepping a voltage supply:


stuW said...

Good post.
I've used and taught Multisim, but now looking for an inexpensive simulator to recommend and use personally.

LTspice looks good - in fact excellent for the price.
I was missing however the ability to parameter sweep - thanks for pointing it out, Its not obvious from the help files.

DaltonHawkPaull said...

Hey James. I just found your blog from a Google search on ltspice when I was trying to remember how to do a parameter sweep (OK I really want to step a parameter sequentially in time during a transient simulation..) Good job on the blog though.

Sinbad said...

Hey DaltonHawkPaull, did you ever figure out how to do that? ( step a parameter sequentially in time during a transient simulation)

codeboy2k said...

@sinbad I do this by using a voltage controlled switch and a pulsed voltage source, to switch in the new parameter (for example a resistor) at time t