For when the path is a loop
1. Variables in LTspice
-
Curly braces
{ }
denote places to substitute variables. Before LTspice can simulate, the contents of the{ }
must resolve to a number, though the substitutions can be several layers deep. -
.param name=foo
statements teach LTspice how to resolve the symbolic names to values. -
.param other=name*2
is also valid! See the Help for the functions available also. -
.param foo=7
, then the resistor value{other}
will resolve to 14 by the start of the simulation.
From LTspice’s main window,
opens the locally-installed documentation in a web browser:
1.1. .param
sweep the base resistance

First, learn to do a parameter sweep by varying the base resistor RB
's value.
Read the documentation for the |
Types of things can be stepped:
Ways the step values can be selected:
The definitions of the specifiers Go there and read about it! |

What does Figure 3 do?
What value of RB
makes V(c) == 5 V?
-
Figure this out by doing a
.param
sweep
RB =
What happens to this “best” value when the transistor’s \(\beta\) or \(h_{FE}\) changes?
1.2. .param
a model value
There are two ways to sweep a model’s parameter value. Which is best depends on your goals.
1.2.2. Custom model with parameter substitutions

%LOCALAPPDATA%
See the effect of different β values on the Lab 2: Fig. 2. BJT beta test jig.
This requires changing a parameter inside a model, and then running a sweep simulation to step that value over a range.
Find the models which show up in the menu at
C:\Users\<username>\AppData\Local\LTspice\lib\cmp\standard.bjt
What else is in the lib\
folder?
Open standard.bjt
and find the .model
statement for the 2N3904 transistor that we’ve been using.
Copy the definition, then add it directly to your schematic as a SPICE Directive (the black .t
icon).
Change the name to make it unique (e.g. to 2N3904x
) so you don’t need to worry about name clashes and trying to figure out which model the simulator will actually use for the simulation.
What does happen when there are two |
.param beta=132
.model 2N3904x npn( ...
+ more
+ Bf={beta} $ <--- see the parameter substitution
+ lots more
+ )
.step param beta 15 450 1