Electronic – How to (.step) change bjt/fet/opamp models in simulations in LTSpice

ltspicespice

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.

Best Answer

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