2.32 PARAMETER command
2.32.1 Syntax
param
parameter
param param-name value ...
parameter param-name value ...
2.32.2 Purpose
Set and view parameters.
2.32.3 Comments
The bare command param lists all defined parameters and their values.
The value may be a number or the name of another parameter. If it is
another parameter, eventually it must resolve to a number. This depth
can be set by the option recursion which has a default value of
20. The depth is limited to prevent infinite recursion.
In a future release, full expressions will be accepted, but this is
not working yet.
All component values, numeric lists such as in PWL, component
and model parameters can be defined using param.
If the same parameter is set more than once, the most recent one
prevails. All instances of the parameter will take the new value.
When a parameter name is used as a value, it may be enclosed by quotes
or curly braces.
2.32.4 Examples
Suppose we have this circuit:
Vpower (vcc 0) dc vcc
Vin (in 0) generator
Q1 (c b e) small
Rc (vcc c) rc
Re (e 0) re
Rb1 (vcc b) rb1
Rb2 (b 0) rb2
.model small npn (bf=beta)
If I try to simulate it now, it will not be very useful. We need to
give our circuit some values:
gnucap> param vcc=10 beta=100 rc=10k re=1k rb1=100k rb2=rc
Let's see what it does:
gnucap> print op v(nodes)
gnucap> op
# v(b) v(c) v(e) v(in) v(vcc)
27. 0.8941 8.3513 0.16652 0. 10.
What happens if I change beta?
gnucap> param beta=200
gnucap> op
# v(b) v(c) v(e) v(in) v(vcc)
27. 0.90128 8.2822 0.17264 0. 10.
Not much changes. Let's try to lower v(c). About 6 should be better.
gnucap> param rb1=68k
gnucap> op
# v(b) v(c) v(e) v(in) v(vcc)
27. 1.2602 4.9866 0.50385 0. 10.
Too low, try again:
gnucap> param rb1=82k
gnucap> op
# v(b) v(c) v(e) v(in) v(vcc)
27. 1.0724 6.7437 0.32726 0. 10.
Too high...
gnucap> param rb1=75k
gnucap> op
# v(b) v(c) v(e) v(in) v(vcc)
27. 1.1586 5.9433 0.4077 0. 10.
Close enough.