.sep(ping) models in LTSpice?

On Fri, 01 Oct 2004 00:17:31 +0100 in sci.electronics.cad, Paul Burridge wrote,

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

Reply to
David Harmon
Loading thread data ...

Hi,

Is there a way of running a number (say

Reply to
Paul Burridge

You can, of course, do this in SS:-)

Kevin Aylward snipped-for-privacy@anasoft.co.uk

formatting link
SuperSpice, a very affordable Mixed-Mode Windows Simulator with Schematic Capture, Waveform Display, FFT's and Filter Design.

Reply to
Kevin Aylward

Paul,

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

Reply to
Mike Engelhardt

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.
Reply to
Paul Burridge
[snip]

Thanks a lot, Mike. I'll check it out.

p.

--

"What is now proved was once only imagin\'d." - William Blake, 1793.
Reply to
Paul Burridge

[snip]

Nice hack.

Is this common in other versions of Spice?

Bob

Reply to
Robert

Bob,

Thanks!

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

Reply to
Mike Engelhardt

Mike,

[snip]

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

Reply to
Robert

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.