@KSKelvin The issue is shown in a basic application to make it easy to understand. The problem is more complex when you have multiple nested subcircuits in a complex schematic, from various manufacturers. In that case I would have to open all kind of models and add various helpers around. I would say is a bug, since standard models and subcircuits will always create this problem. You explanation clarifies why and how to work-around, thanks. Not even opening here the can of worms with encrypted models.
For example, when the subcircuit model is embedded is a library file it makes no difference how many helpers are placed around, inside and outside the model. I still get that error: Warning: Singular matrix. Check node B1•X2#BRANCH
Maybe I am missing some other details, but still smells like a bug.
*CONNECTIONS: NON-INVERTING INPUT
* | INVERTING INPUT
* | | POSITIVE POWER SUPPLY
* | | | NEGATIVE POWER SUPPLY
* | | | | OUTPUT
* | | | | |
.SUBCKT MyCompx 1 2 3 7 5
XQ1 5 6 4 DMMT3904
R4 1 2 1G
B2 10 8 V=if(I(B1)<50uA, 2.5m, -2.5m)
B1 4 6 I=if(V(10)>V(9), -600u, 200u)
R1 8 2 100
R2 9 2 100
C2 8 9 10p
R3 6 4 200k
XD1 4 6 BAS16
R5 4 3 1G
R6 10 9 1G
R6 4 7 1u
.model DMMT3904 NPN (
+ IS=20.3f NF=1.00 BF=274 VAF=114 IKF=36.4m ISE=6.99p NE=2.00 BR=4.00 NR=1.00 VAR=24.0 IKR=90.0m RE=0.657 RB=2.63
+ XTB=1.5 CJE=8.29p VJE=1.10 MJE=0.500 CJC=7.10p VJC=0.300 MJC=0.300 TF=426p TR=71.3n EG=1.12 RC=0.263)
.model BAS16 D (
+ IS=6.75697e-09 RS=1.11407 N=1.92072 EG=1.17037 XTI=0.5 BV=165 IBV=0.0001 CJO=6.03442e-13 VJ=2.38765 M=0.1 FC=0.5 TT=5.1937e-09 KF=0 AF=1)
.ENDS MyCompx