.sep(ping) models in LTSpice?

P

Paul Burridge

Guest
Hi,

Is there a way of running a number (say<5) of dc sweep simulations of
an amp stage with a different active device model (FET/BJT) for each
sweep and thereby seeing all the resulting curves on the same plot
pane?

Thanks,

p.
--

"What is now proved was once only imagin'd." - William Blake, 1793.
 
On Fri, 01 Oct 2004 00:17:31 +0100 in sci.electronics.cad, Paul Burridge
<pb@notthisbit.osiris1.co.uk> wrote,

Is there a way of running a number (say<5) of dc sweep simulations of
an amp stage with a different active device model (FET/BJT) for each
sweep and thereby seeing all the resulting curves on the same plot
pane?
Is SwCAD\examples\Educational\stepmodelparam.asc what you mean?
 
On Thu, 30 Sep 2004 23:35:25 GMT, David Harmon <source@netcom.com>
wrote:

On Fri, 01 Oct 2004 00:17:31 +0100 in sci.electronics.cad, Paul Burridge
pb@notthisbit.osiris1.co.uk> wrote,

Is there a way of running a number (say<5) of dc sweep simulations of
an amp stage with a different active device model (FET/BJT) for each
sweep and thereby seeing all the resulting curves on the same plot
pane?

Is SwCAD\examples\Educational\stepmodelparam.asc what you mean?
Not quite. I want to repeatedly replace the whole model rather than
just elements of one model. For instance, multiple runs of a stage
with a different transistor per run.

--

"What is now proved was once only imagin'd." - William Blake, 1793.
 
On Fri, 01 Oct 2004 14:31:40 GMT, "Mike Engelhardt" <nospam@spam.org>
wrote:


[snip]
The LTspice schematic is below.
Thanks a lot, Mike. I'll check it out.

p.
--

"What is now proved was once only imagin'd." - William Blake, 1793.
 
"Mike Engelhardt" <nospam@spam.org> wrote in message
news:gTd7d.22880$QJ3.18624@newssvr21.news.prodigy.com...
Paul,

Is there a way of running a number (say<5) of dc sweep
simulations of an amp stage with a different active
device model (FET/BJT) for each sweep and thereby
seeing all the resulting curves on the same plot
pane?

Is SwCAD\examples\Educational\stepmodelparam.asc what
you mean?

Not quite. I want to repeatedly replace the whole model
rather than just elements of one model. For instance,
multiple runs of a stage with a different transistor per run.

The ".step param ..." only steps numerical parameters, not
strings, so it's not straightforward to .step model names.
However, it can be done if you make the model names numeric.
Here is an example on the netlist level:

[snip]
TEXT 520 320 Left 0 !.STEP param M list 3 4 5
Nice hack.

Is this common in other versions of Spice?

Bob
 
Paul Burridge wrote:
On Thu, 30 Sep 2004 23:35:25 GMT, David Harmon <source@netcom.com
wrote:

On Fri, 01 Oct 2004 00:17:31 +0100 in sci.electronics.cad, Paul
Burridge <pb@notthisbit.osiris1.co.uk> wrote,

Is there a way of running a number (say<5) of dc sweep simulations
of an amp stage with a different active device model (FET/BJT) for
each sweep and thereby seeing all the resulting curves on the same
plot pane?

Is SwCAD\examples\Educational\stepmodelparam.asc what you mean?

Not quite. I want to repeatedly replace the whole model rather than
just elements of one model. For instance, multiple runs of a stage
with a different transistor per run.
You can, of course, do this in SS:)

Kevin Aylward
salesEXTRACT@anasoft.co.uk
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.
 
Paul,

Is there a way of running a number (say<5) of dc sweep
simulations of an amp stage with a different active
device model (FET/BJT) for each sweep and thereby
seeing all the resulting curves on the same plot
pane?

Is SwCAD\examples\Educational\stepmodelparam.asc what
you mean?

Not quite. I want to repeatedly replace the whole model
rather than just elements of one model. For instance,
multiple runs of a stage with a different transistor per run.
The ".step param ..." only steps numerical parameters, not
strings, so it's not straightforward to .step model names.
However, it can be done if you make the model names numeric.
Here is an example on the netlist level:

*
Q1 C B 0 0 {M}
V1 C 0 0
I1 0 B 0
..dc V1 0 3 1m I1 20u 100u 20u
..model 3 NPN(BF=100)
..model 4 NPN(BF=101)
..model 5 NPN(BF=102)
..STEP param M list 3 4 5
..end

The LTspice schematic is below.

--Mike

--- snip ---
Version 4
SHEET 1 896 680
WIRE 32 384 32 368
WIRE 32 288 32 272
WIRE 32 272 128 272
WIRE 192 384 192 320
WIRE 192 224 192 192
WIRE 192 192 336 192
WIRE 336 192 336 224
WIRE 336 304 336 384
FLAG 192 384 0
FLAG 336 384 0
FLAG 32 384 0
FLAG 192 192 C
FLAG 32 272 B
SYMBOL npn 128 224 R0
SYMATTR InstName Q1
SYMATTR Value {M}
SYMBOL voltage 336 208 R0
SYMATTR InstName V1
SYMATTR Value 0
SYMBOL current 32 368 M180
WINDOW 0 24 79 Left 0
WINDOW 3 24 0 Left 0
SYMATTR InstName I1
SYMATTR Value 0
TEXT 16 456 Left 0 !.dc V1 0 3 1m I1 20u 100u 20u
TEXT 520 200 Left 0 !.model 3 NPN(BF=100)
TEXT 520 232 Left 0 !.model 4 NPN(BF=101)
TEXT 520 264 Left 0 !.model 5 NPN(BF=102)
TEXT 520 320 Left 0 !.STEP param M list 3 4 5
 
Bob,

Is there a way of running a number (say<5) of dc sweep
simulations of an amp stage with a different active
device model (FET/BJT) for each sweep and thereby
seeing all the resulting curves on the same plot
pane?

Is SwCAD\examples\Educational\stepmodelparam.asc what
you mean?

Not quite. I want to repeatedly replace the whole model
rather than just elements of one model. For instance,
multiple runs of a stage with a different transistor per
run.

The ".step param ..." only steps numerical parameters, not
strings, so it's not straightforward to .step model names.
However, it can be done if you make the model names
numeric. Here is an example on the netlist level:

*
Q1 C B 0 0 {M}
V1 C 0 0
I1 0 B 0
.dc V1 0 3 1m I1 20u 100u 20u
.model 3 NPN(BF=100)
.model 4 NPN(BF=101)
.model 5 NPN(BF=102)
.STEP param M list 3 4 5
.end
[snip]
TEXT 520 320 Left 0 !.STEP param M list 3 4 5

Nice hack.
Thanks!

Is this common in other versions of Spice?
Not really. For example, that deck above
won't parse in PSpice, but I think that PSpice
does allow string substitutions by another
means. BTW, the hack can be used to refer
to existing non-numeric model names by using
"ako". This would be more useful to directly
address the OP's wish. Here's an example on
the netlist level:

*
Q1 N002 N001 0 0 {M}
V1 N002 0 0
I1 0 N001 20u
..lib standard.bjt
..dc V1 0 3 1m
..STEP param M list 1 2
..model 1 ako:2N3904
..model 2 ako:2N2222
..end

Below is the LTspice schematic.

--Mike

--- snip ---
Version 4
SHEET 1 880 680
WIRE 32 384 32 368
WIRE 32 288 32 272
WIRE 32 272 96 272
WIRE 160 336 160 320
WIRE 160 224 160 208
WIRE 160 208 304 208
WIRE 304 208 304 240
WIRE 304 320 304 336
FLAG 32 384 0
FLAG 160 336 0
FLAG 304 336 0
SYMBOL npn 96 224 R0
SYMATTR InstName Q1
SYMATTR Value {M}
SYMBOL voltage 304 224 R0
SYMATTR InstName V1
SYMATTR Value 0
SYMBOL current 32 368 M180
WINDOW 0 23 75 Left 0
WINDOW 3 24 0 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName I1
SYMATTR Value 20ľ
TEXT 120 432 Left 0 !.dc V1 0 3 1m
TEXT 432 272 Left 0 !.STEP param M list 1 2
TEXT 432 296 Left 0 !.model 1 ako:2N3904
TEXT 432 320 Left 0 !.model 2 ako:2N2222
 
Mike,

"Mike Engelhardt" <nospam@spam.org> wrote in message
news:9B28d.6011$nj.3016@newssvr13.news.prodigy.com...
Bob,

Is there a way of running a number (say<5) of dc sweep
simulations of an amp stage with a different active
device model (FET/BJT) for each sweep and thereby
seeing all the resulting curves on the same plot
pane?
[snip]
TEXT 520 320 Left 0 !.STEP param M list 3 4 5

Nice hack.

Thanks!

Is this common in other versions of Spice?

Not really. For example, that deck above
won't parse in PSpice, but I think that PSpice
does allow string substitutions by another
means. BTW, the hack can be used to refer
to existing non-numeric model names by using
"ako". This would be more useful to directly
address the OP's wish. Here's an example on
the netlist level:

*
Q1 N002 N001 0 0 {M}
V1 N002 0 0
I1 0 N001 20u
.lib standard.bjt
.dc V1 0 3 1m
.STEP param M list 1 2
.model 1 ako:2N3904
.model 2 ako:2N2222
.end

Below is the LTspice schematic.
Nice enhancement.

Saves some cutting and pasting to get the first hack to work.

The string substitution you mention in PSpice, does it allow Model names to
be swapped from lists? Or perhaps just Model parameters.

Bob
 

Welcome to EDABoard.com

Sponsor

Back
Top