[wiki=Main Page]return to diyAudio Wiki Main Page[/wiki]
[wiki=LTSpice and What the New User Should Know]back up[/wiki]
[h=.param]%2[/h]
use the .param command to assign a value to a variable name. For example if you want 10 resistors to all have the same value, and want to easily change the value without changing all 10 resistors individually.
include the spice directive on your schematic:
then for each resistor, set the value to {Rvar} The curly braces tell Spice to evaluate what's inside the curly braces and use the result as the value.
So to do a 1K potentiometer, you need 2 resistors connected in series, and one with the value {Rvar}, the second {1k-Rvar}
Mathematical expressions can be arbitrarily complex, full details are in the help file under .param
[h=.step]%2[/h]
If you want try multiple different component values, use the .step command. Example:
As a result of running N different simulations, any node you click on will result in N waveforms overlaid on eachother on the waveform display. If you only have one net selected, then the different runs will be in different colors according to whatever color scheme you have set. To figure out which is which (the following was written by Helmut Sennewald, moderator of the yahoo group, all around LTspice expert, and extraordinarily helpful guy):
[wiki=LTSpice and What the New User Should Know]back up[/wiki]
[h=.param]%2[/h]
use the .param command to assign a value to a variable name. For example if you want 10 resistors to all have the same value, and want to easily change the value without changing all 10 resistors individually.
include the spice directive on your schematic:
.param Rvar 1k
then for each resistor, set the value to {Rvar} The curly braces tell Spice to evaluate what's inside the curly braces and use the result as the value.
So to do a 1K potentiometer, you need 2 resistors connected in series, and one with the value {Rvar}, the second {1k-Rvar}
Mathematical expressions can be arbitrarily complex, full details are in the help file under .param
[h=.step]%2[/h]
If you want try multiple different component values, use the .step command. Example:
.step param Rvar list 100 200 300 400 500
will run 5 simulations with the listed values substituted anywhere the parameter Rvar is used. There are different forms of the .step command, you know where to look. As a result of running N different simulations, any node you click on will result in N waveforms overlaid on eachother on the waveform display. If you only have one net selected, then the different runs will be in different colors according to whatever color scheme you have set. To figure out which is which (the following was written by Helmut Sennewald, moderator of the yahoo group, all around LTspice expert, and extraordinarily helpful guy):
Make the waveform window active.
Click on the label you are interested. It's the text near the top
of the waveform window, e.g. V(out).
Now you have a cursor attached to the curve.
You can step up/down with the cursor keys.
Move the cursor near the cross hair. When you see the "1" then
click the right mouse button. A small status window appear.
Cursor Step Information
Cursor 1: Val=2 (Run: 3/5)
There is also a selection in the Plot settings menu.
Plot Settings -> Select Steps
Click on the label you are interested. It's the text near the top
of the waveform window, e.g. V(out).
Now you have a cursor attached to the curve.
You can step up/down with the cursor keys.
Move the cursor near the cross hair. When you see the "1" then
click the right mouse button. A small status window appear.
Cursor Step Information
Cursor 1: Val=2 (Run: 3/5)
There is also a selection in the Plot settings menu.
Plot Settings -> Select Steps
Last edited: