This one does show the bug (ngspice-45.2 and older): Test call to subcircuit within subcircuit ***************************************************************************** * AMC1351 SUBCIRCUIT * Precision, 5-V Input, Reinforced Isolated Amplifier * source AMC1351 .SUBCKT AMC1351_kicad VDD1 INP INN GND1 GND2 OUTN OUTP VDD2 .include AMC1351.lib XDEVICE VDD1 INP GND1 GND2 OUTN OUTP VDD2 AMC1351 .ENDS X1 v1 in gnd gnd gnd outn outp v2 AMC1351_kicad Vd1 v1 0 5 Vin in 0 2.5 Vd2 v2 0 5 .control op print...
What library are you refering to? I guess you have to google for 6AN8t and 6AN8p spice models.
No problem to run this (with set ngbehavior=ltpsa in .spiceinit): Test ***************************************************************************** * AMC1351 SUBCIRCUIT * Precision, 5-V Input, Reinforced Isolated Amplifier * source AMC1351 .include AMC1351.lib *.SUBCKT AMC1351 VDD1 IN GND1 GND2 OUTN OUTP VDD2 X1 v1 in gnd gnd outn outp v2 AMC1351 Vd1 v1 0 5 Vin in 0 2.5 Vd2 v2 0 5 .control op print in outp-outn .endc .end with output (amplification 0.4V/V) No. of Data Rows : 1 in = 2.500000e+00...
The ngspice manual, chapter 11.3.2 list the items which may be swept with a .dc command: voltage or current sources, resistors, or the temperature. If you want to sweep something else, e.g. parameters, you have to resort to the ngspice control language and create a script. Please have a look at https://ngspice.sourceforge.io/ngspice-control-language-tutorial.html#step for an intro and examples.
The ngspice manual, chapter 11.3.2 list the item which may be swept with a .dc command: voltage or current sources, resistors, or the temperature. If you want to sweep something else, e.g. parameters, you have to resort to the ngspice control language and create a script. Please have a look at https://ngspice.sourceforge.io/ngspice-control-language-tutorial.html#step for an intro and examples.
You might want to understand how a behavioral capacitor is modelled: Cxxx n1 n2 C = {equation} or Cxxx n1 n2 {equation} --> Exxx n-aux 0 n2 n1 1 Cxxx n-aux 0 1 Bxxx n1 n2 I = i(Exxx) * equation or Cxxx n1 n2 Q = {equation} --> Gxxx n1 n2 n-aux 0 1 Lxxx n-aux 0 1 Bxxx 0 n-aux I = equation
Your circuit is violating a basic spice rule: each node has to have a dc path to ground. Otherwise the operating point solution may become impossible. Node 2 is floating dc-wise. Place a 1G resistor from 2 to gnd, and op is available without warnings.
Thanks for the report. I have pushed a fix to git branch pre-master-46.