@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.
@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.
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
I recommend using a voltage source with 0V for current monitoring.
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.
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.
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.
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 ?