I have a filter circuit I'm playing with, and I'm getting the warning on L4 in the circuit. I've split L4 into two inductors below and I'm getting the error on L4b. If I remove L4b (or all of L4) the warning goes away, but the circuit doesn't work at all like it's supposed to. With the inductor in, it works at least pretty close to what it's supposed to, though it doesn't exactly match the filter design program's output. Not matching the filter design program is not a big surprise, though.
I'm not sure of there's something wrong, but the warning are annoying and make me thing something is wrong.
.title 45MHz differential filter test code
* positive input
* | negative input
* | | positive output
* | | | negative output
* | | | |
.SUBCKT DiffFilt45MHz inp inm outp outm
C1 inp inm 1.4n
L1 inp inm 2.21n
C2a inp a1 562p
L2a inp a1 20.5n
C3a a1 a2 604p
L3a a1 a2 22.1n
C2b inm b1 562p
L2b inm b1 20.5n
C3b b1 b2 604p
L3b b1 b2 22.1n
C4 a2 b2 2.26n
L4a a2 0 2.74n
L4b b2 0 2.74n
*L4 a2 b2 5.48n
C5a a2 a3 1.62n
L5a a2 a3 7.32n
C6a a3 outp 1.69n
L6a a3 outp 7.68n
C5b b2 b3 1.62n
L5b b2 b3 7.32n
C6b b3 outm 1.69n
L6b b3 outm 7.68n
C7 outp outm 1.19n
L7 outp outm 10.46n
.ENDS
V1 inp inm dc 0 AC 2 sin(0 2 45MEG 0 0 0)
Rbias1 inp 0 100k
Rbias2 inm 0 100k
Rinp inp inp1 50
Rinm inm inm1 50
X1 inp1 inm1 outp outm DiffFilt45MHz
Routp outp 0 50
Routm outm 0 50
.control
*tran 1ns 102000ns 101000ns
*plot v(outp), v(outm)
*plot v(inp1), v(inm1)
ac lin 50000 40000000 50000000
plot db((v(outp)-v(outm))/(v(inp1)-v(inm1)))
.endc
.end
Oh, I forgot to say, this is with both version 44.2 and with the end of the git tree.
[It would be nice to upload a schematic and also state exactly what annoys you.]
With vsn. 44 I see that ngspice needs the
Transient opto find the DC operating point which is indeed rather unexpected, unless there are loops of V,C elements or cutsets of inductors (that's where the schematic comes in).I do not see any ngspice bug here. This is a circuit made of linear elements only. Thus there is no need for any operating point calculation. Therefore you might run the simulation by the following .control section:
Last edit: Holger Vogt 2025-02-25
Ok, a schematic is attached.
The full output is:
This is with L4a and L4b commented out and L4 uncommented, but with the other way around, you get the same warnings on L4b.
I don't know what these things mean, and from what I can tell, there's nothing wrong with the circuit or the spice code. I assume a "singular matrix" is an unconnected node. I have no idea what "True gmin stepping" is. I don't know if these things affect the results of the simulation.
Although this has no active elements now, it will eventually go into a circuit that does. And why can't you run an operating point analysis on a circuit that has no active elements? Everything has a DC connection to ground, it should be able to compute it.
It's confusing to get warnings like this; it make me think there is something wrong.
Schematic got lost, actually add it.
Are you aware of that the connection between L5b and L6b is broken?
Oops. I just threw that schematic together so you would have something to look at. It's not used for anything else at the moment. But thanks for the heads up.
You are trying to simulate the operating point of a circuit like this:
This is not possible. Don't know the reason, maybe Marcel can explain.
It will be possible if you add a small series resistance to each inductor, like
Capacitor voltages and inductor currents are the unknowns (to SPICE) to solve for, the former with KVL, the latter with KCL. The circuit under consideration has (at least) two loops of capacitors: C1, C2x, C3x, C4, and C4, C5x, C6x, C7. Furthermore L3a, L4, L5a is one cutset of inductors, L4 with L3b and L5b is another (maybe there are more, the definition of a cutset is not really intuitive). Picking individual voltages or currents and trying to prove that they can not be the operating point is quite difficult.
If the inductors and capacitors have some loss (combined with an input source and all of its derivatives that are exactly 0) the problem becomes very easy, but that is not what SPICE sees here. The solution it eventually finds is (probably) based on numerical inaccuracies in the solver that can be thought of to be equivalent to circuit losses.
Looking at the time-domain transient of this circuit might reveal some horrible details caused by its lossless parts. Maybe I will try that later today.
Last edit: marcel hendrix 2025-03-02