Persistent Bug - Warning: Singular matrix. Check node B

@KSKelvin I see, you always have good insight on all the spice concepts. When is your book going to come out : )

Here is the explanation for the behavior observed by @KSKelvin : SPICE uses Modified nodal analysis - Wikipedia which directly calculates the node voltages and the currents through voltage sources. The current through the small resistor, on the other hand, is calculated indirectly by dividing the voltage difference between its terminals by its resistance. With a resistance of 1u, the tolerances of the voltages are almost as large as the voltage difference, causing the observed imprecise results.

2 Likes

@frank.wiedmann Thanks! I now understand why in .qraw, there is an .alias command that shows the resistor current calculated from the conductance multiplied by the voltage difference across the resistor.

2 Likes

I always uses inductor with some rser for current monitoring…

To me it feels to be more accurate, but I never verify it.

Even for current shunt resistor, I prefer to use 1nH inductor with some mOhm rser

1 Like

I recommend using a voltage source with 0V for current monitoring.

3 Likes

Guys, I am the only one that think spitting out a “Warning: Singular matrix. Check node …” error messages is a fatal bug? Forget about “work around” and clever explanations. There is an infinity of scenarios where this problem can pop-up and can mess up everything. My example shows something tied just incidentally to GND. What about floating nodes? What about encrypted models? Having this kind of unsolicited net handling and random error messages will absolutely eliminate any chance of working out a complex circuit. You can have a few hundred such nodes all around. Would you agree this is not acceptable?

It might be a good idea if “Stuff with jumper” inserted a 0V voltage source instead of a short when there are names on both sides, so that both names are kept (even though this adds an additional variable to the circuit matrix). And the GUI should make it impossible to put different names on the same node or to put a name on a node connected to GND.

1 Like

A singular matrix is just a symptom of a problem in the circuit netlist. It’s the unintended renaming of nodes that should be fixed.

1 Like

Frank, I definitely agree with you that we should do that or that. The problem is with subcircuits with no access inside, from various vendors.

Node names assigned at the pins of a subcircuit should not affect the local node names inside the subcircuit. If that really happens, I would consider it a bug.

Hi Frank, that’s precisely my point. I lost a truckload of time to chase down weird errors with vendor models. At the end I got an unencrypted model under NDA and I was able to chase down this issue to net names messing up. I created the simplified examples only to be able to share and describe the issue.

1 Like

I still wouldn’t exclude the possibility that the problems are caused by a badly written model rather than by a bug in QSPICE. Have you read An Op-Ed on Op-Amp Modeling - Qorvo ?

I receive lots of message “Warning : Singular matrix. Check node…” in some simulations in QSPICE with my own models and in my case , the simulation continues and succeeds…The simulation with this multiple warning, does not bug whatsoever despite these warnings,and I get reliable results. In some sweeping of parameters, I get either such warning or for other values of the sweeping, no warning at all, but the whole simlation succeeds nevertheless…

example :1 of 150 steps: .step tol=-25 vcc=70
2 of 150 steps: .step tol=0 vcc=70
3 of 150 steps: .step tol=25 vcc=70
4 of 150 steps: .step tol=-25 vcc=170
5 of 150 steps: .step tol=0 vcc=170
6 of 150 steps: .step tol=25 vcc=170
7 of 150 steps: .step tol=-25 vcc=270
8 of 150 steps: .step tol=0 vcc=270
9 of 150 steps: .step tol=25 vcc=270
10 of 150 steps: .step tol=-25 vcc=370
11 of 150 steps: .step tol=0 vcc=370
12 of 150 steps: .step tol=25 vcc=370
13 of 150 steps: .step tol=-25 vcc=470
14 of 150 steps: .step tol=0 vcc=470
15 of 150 steps: .step tol=25 vcc=470
16 of 150 steps: .step tol=-25 vcc=570
17 of 150 steps: .step tol=0 vcc=570
18 of 150 steps: .step tol=25 vcc=570
19 of 150 steps: .step tol=-25 vcc=670
20 of 150 steps: .step tol=0 vcc=670
21 of 150 steps: .step tol=25 vcc=670
22 of 150 steps: .step tol=-25 vcc=770
23 of 150 steps: .step tol=0 vcc=770
24 of 150 steps: .step tol=25 vcc=770
25 of 150 steps: .step tol=-25 vcc=870
26 of 150 steps: .step tol=0 vcc=870
27 of 150 steps: .step tol=25 vcc=870
28 of 150 steps: .step tol=-25 vcc=970
29 of 150 steps: .step tol=0 vcc=970
30 of 150 steps: .step tol=25 vcc=970
31 of 150 steps: .step tol=-25 vcc=1070
32 of 150 steps: .step tol=0 vcc=1070
33 of 150 steps: .step tol=25 vcc=1070
34 of 150 steps: .step tol=-25 vcc=1170
35 of 150 steps: .step tol=0 vcc=1170
36 of 150 steps: .step tol=25 vcc=1170
37 of 150 steps: .step tol=-25 vcc=1270
38 of 150 steps: .step tol=0 vcc=1270
39 of 150 steps: .step tol=25 vcc=1270
40 of 150 steps: .step tol=-25 vcc=1370
41 of 150 steps: .step tol=0 vcc=1370
42 of 150 steps: .step tol=25 vcc=1370
43 of 150 steps: .step tol=-25 vcc=1470
44 of 150 steps: .step tol=0 vcc=1470
45 of 150 steps: .step tol=25 vcc=1470
46 of 150 steps: .step tol=-25 vcc=1570
47 of 150 steps: .step tol=0 vcc=1570
48 of 150 steps: .step tol=25 vcc=1570
49 of 150 steps: .step tol=-25 vcc=1670
50 of 150 steps: .step tol=0 vcc=1670
51 of 150 steps: .step tol=25 vcc=1670
52 of 150 steps: .step tol=-25 vcc=1770
53 of 150 steps: .step tol=0 vcc=1770
54 of 150 steps: .step tol=25 vcc=1770
55 of 150 steps: .step tol=-25 vcc=1870
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
56 of 150 steps: .step tol=0 vcc=1870
57 of 150 steps: .step tol=25 vcc=1870
58 of 150 steps: .step tol=-25 vcc=1970
59 of 150 steps: .step tol=0 vcc=1970
60 of 150 steps: .step tol=25 vcc=1970
61 of 150 steps: .step tol=-25 vcc=2070
62 of 150 steps: .step tol=0 vcc=2070
63 of 150 steps: .step tol=25 vcc=2070
64 of 150 steps: .step tol=-25 vcc=2170
65 of 150 steps: .step tol=0 vcc=2170
66 of 150 steps: .step tol=25 vcc=2170
67 of 150 steps: .step tol=-25 vcc=2270
68 of 150 steps: .step tol=0 vcc=2270
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
69 of 150 steps: .step tol=25 vcc=2270
70 of 150 steps: .step tol=-25 vcc=2370
71 of 150 steps: .step tol=0 vcc=2370
72 of 150 steps: .step tol=25 vcc=2370
73 of 150 steps: .step tol=-25 vcc=2470
74 of 150 steps: .step tol=0 vcc=2470
75 of 150 steps: .step tol=25 vcc=2470
76 of 150 steps: .step tol=-25 vcc=2570
77 of 150 steps: .step tol=0 vcc=2570
78 of 150 steps: .step tol=25 vcc=2570
79 of 150 steps: .step tol=-25 vcc=2670
80 of 150 steps: .step tol=0 vcc=2670
81 of 150 steps: .step tol=25 vcc=2670
82 of 150 steps: .step tol=-25 vcc=2770
83 of 150 steps: .step tol=0 vcc=2770
84 of 150 steps: .step tol=25 vcc=2770
85 of 150 steps: .step tol=-25 vcc=2870
86 of 150 steps: .step tol=0 vcc=2870
87 of 150 steps: .step tol=25 vcc=2870
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
88 of 150 steps: .step tol=-25 vcc=2970
89 of 150 steps: .step tol=0 vcc=2970
90 of 150 steps: .step tol=25 vcc=2970
91 of 150 steps: .step tol=-25 vcc=3070
92 of 150 steps: .step tol=0 vcc=3070
93 of 150 steps: .step tol=25 vcc=3070
94 of 150 steps: .step tol=-25 vcc=3170
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
95 of 150 steps: .step tol=0 vcc=3170
96 of 150 steps: .step tol=25 vcc=3170
97 of 150 steps: .step tol=-25 vcc=3270
98 of 150 steps: .step tol=0 vcc=3270
99 of 150 steps: .step tol=25 vcc=3270
100 of 150 steps: .step tol=-25 vcc=3370
101 of 150 steps: .step tol=0 vcc=3370
102 of 150 steps: .step tol=25 vcc=3370
103 of 150 steps: .step tol=-25 vcc=3470
104 of 150 steps: .step tol=0 vcc=3470
105 of 150 steps: .step tol=25 vcc=3470
106 of 150 steps: .step tol=-25 vcc=3570
107 of 150 steps: .step tol=0 vcc=3570
108 of 150 steps: .step tol=25 vcc=3570
109 of 150 steps: .step tol=-25 vcc=3670
110 of 150 steps: .step tol=0 vcc=3670
111 of 150 steps: .step tol=25 vcc=3670
112 of 150 steps: .step tol=-25 vcc=3770
113 of 150 steps: .step tol=0 vcc=3770
114 of 150 steps: .step tol=25 vcc=3770
115 of 150 steps: .step tol=-25 vcc=3870
116 of 150 steps: .step tol=0 vcc=3870
117 of 150 steps: .step tol=25 vcc=3870
118 of 150 steps: .step tol=-25 vcc=3970
119 of 150 steps: .step tol=0 vcc=3970
120 of 150 steps: .step tol=25 vcc=3970
121 of 150 steps: .step tol=-25 vcc=4070
122 of 150 steps: .step tol=0 vcc=4070
123 of 150 steps: .step tol=25 vcc=4070
124 of 150 steps: .step tol=-25 vcc=4170
125 of 150 steps: .step tol=0 vcc=4170
126 of 150 steps: .step tol=25 vcc=4170
127 of 150 steps: .step tol=-25 vcc=4270
128 of 150 steps: .step tol=0 vcc=4270
129 of 150 steps: .step tol=25 vcc=4270
130 of 150 steps: .step tol=-25 vcc=4370
131 of 150 steps: .step tol=0 vcc=4370
132 of 150 steps: .step tol=25 vcc=4370
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
133 of 150 steps: .step tol=-25 vcc=4470
134 of 150 steps: .step tol=0 vcc=4470
135 of 150 steps: .step tol=25 vcc=4470
136 of 150 steps: .step tol=-25 vcc=4570
137 of 150 steps: .step tol=0 vcc=4570
138 of 150 steps: .step tol=25 vcc=4570
Warning: Singular matrix. Check nodes P1•X1 and B10•X1#BRANCH
139 of 150 steps: .step tol=-25 vcc=4670
140 of 150 steps: .step tol=0 vcc=4670
141 of 150 steps: .step tol=25 vcc=4670
142 of 150 steps: .step tol=-25 vcc=4770
143 of 150 steps: .step tol=0 vcc=4770
144 of 150 steps: .step tol=25 vcc=4770
Warning: Singular matrix. Check nodes P2•X1 and B10•X1#BRANCH
145 of 150 steps: .step tol=-25 vcc=4870
146 of 150 steps: .step tol=0 vcc=4870
147 of 150 steps: .step tol=25 vcc=4870
148 of 150 steps: .step tol=-25 vcc=4970
149 of 150 steps: .step tol=0 vcc=4970
150 of 150 steps: .step tol=25 vcc=4970
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH
151 of 150 steps: .step tol=-25 vcc=5000
152 of 150 steps: .step tol=0 vcc=5000
153 of 150 steps: .step tol=25 vcc=5000
Warning: Singular matrix. Check nodes P2•X1 and B11•X1#BRANCH

Total elapsed time: 66.0943 seconds.

and it seems that reducing time step makes these warnings disappear, but without affecting the preciseness of the results.