6
\$\begingroup\$

Is there a way to change bjt/jfet/opamp model in simulation in LTSpice (similarly to changing parameters with .step command)?

I would like to compare different bjt/jfet/opamp models, run a number of simulations with different models, then display the transient/fft curves in the same window, to compare their performance in a given circuit.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thanks for asking this question. Because of the answer you were handed, I learned something new about LTspice! \$\endgroup\$
    – jonk
    Commented Apr 17, 2017 at 17:26

1 Answer 1

9
\$\begingroup\$

You can do this by using a little trick: the .param statement in Spice only works with numbers, but Spice has a way to rename models with numerical names, the ako (Also Known As) option. IIRC, this may not be documented in LTSpice docs, but it does exactly what you want. See ltwiki:AKO Aliases (A Kind Of) for a little more information

To sweep models, simply use .model n ako:<name> to rename each model you want to sweep, and then use a .step param MParam list 1 2 .. n to sweep through those models. See below for an example, where I sweep through three simple diode models plus a "real" diode model.

simulation simulation results

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Very helpful. +1. I knew about and often use "ako". But I hadn't realized that I could use it with LTspice in just that way. It suggests other ideas to me, now, which I may yet apply. Nice to know. \$\endgroup\$
    – jonk
    Commented Apr 17, 2017 at 17:22
  • 1
    \$\begingroup\$ Stepping through diode models works perfectly, but I couldn't figure out how to step through (opamp) subcircuits? Should this trick work with .subckt too? \$\endgroup\$
    – remageFrs
    Commented Apr 19, 2017 at 13:06
  • \$\begingroup\$ @remageFrs did you get it to work with .subckt too ? \$\endgroup\$
    – user103776
    Commented Mar 8, 2023 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.