I am trying to use GMIN as a parameter in a netlist. This is possible in LTspice and PSpice, but when I try to use it in ngspice, there is an error that {gmin} is not a known parameter. Is it possible to include it as a parameter by default? Or at least is there a workaround where you can use GMIN without defining the exact value but let the solver provide it?
Here is an example how I want to use it:
R_1 N007 N006 {gmin}
Set PSPICE compatibility mode(manual 16.14.5).
Thanks for the reference. If I understand correctly this can in rare cases cause issues with normally working ngspice netlists. Isn't there an alternative solution where you can define and use GMIN?
Any such problem would mean that some valid ngspice syntax is altered in compatibility mode. I do not know any examples. Compatibility mode is mostly about changing foreign formats. You can see what it has done to your netlist with "listing e" after loading.
But if you really just want a single definition that sets option GMIN and a .param with the same name, that can be done by scripting, but is not pretty.
.param parameters are evaluated upfront, before the simulation is started. In ps compatibility mode, ngspice just adds the line
.param gmin=1e-12
to the netlist.During searching for the operating point, during gmin stepping, gmin is varied by the simulator. I am not aware of any other automatic setting of gmin.
.option gmin=<value>
is available, again only upfront or in a .control language script (unfortunately not for compat mode ps).Last edit: Holger Vogt 2023-06-30
A little scripting may help: