0
\$\begingroup\$

I'm having problems simulating the following circuit using ngspice alongside Qucs.

The main problem I can see in log is that is acusing an singular matrix.

I imagine the problem is related to how the transformer is placed, but could not find anything related.

The ngspice code generated is:

* Qucs 0.0.19  /home/eduardo/projetoSimoes/qucs/initialCircuit.sch

.SUBCKT Bridges_GBU4G  gnd  _net0 _net1 _net2 _net3
DD1 _net1 _net0 DMOD_D1 
.MODEL DMOD_D1 D(Is=2.46092e-06 N=2.62593 Rs=0.00370811 Cj0=2.8562e-10 Vj=0.25 M=0.332534 Fc=0.5 Tt=2.88539e-06 Bv=440 Ibv=0.05 Af=1 Kf=0) 
DD2 _net1 _net2 DMOD_D2 
.MODEL DMOD_D2 D(Is=2.46092e-06 N=2.62593 Rs=0.00370811 Cj0=2.8562e-10 Vj=0.25 M=0.332534 Fc=0.5 Tt=2.88539e-06 Bv=440 Ibv=0.05 Af=1 Kf=0) 
DD3 _net2 _net3 DMOD_D3 
.MODEL DMOD_D3 D(Is=2.46092e-06 N=2.62593 Rs=0.00370811 Cj0=2.8562e-10 Vj=0.25 M=0.332534 Fc=0.5 Tt=2.88539e-06 Bv=440 Ibv=0.05 Af=1 Kf=0) 
DD4 _net0 _net3 DMOD_D4 
.MODEL DMOD_D4 D(Is=2.46092e-06 N=2.62593 Rs=0.00370811 Cj0=2.8562e-10 Vj=0.25 M=0.332534 Fc=0.5 Tt=2.88539e-06 Bv=440 Ibv=0.05 Af=1 Kf=0) 
.ENDS

XD1 0  _net0 _net1 _net2 Vout Bridges_GBU4G
V1 Vin 0 DC 0 SIN(0 127 60 0 0) AC 127
R1 _net1 Vout  36
C1 _net1 Vout  1U 
L2 0  Vin 1
L1 _net2  _net0 1
K1 L1 L2 0.1 
.control
echo "" > spice4qucs.cir.noise
echo "" > spice4qucs.cir.pz
tran 0.0001 0.1 0 
write initialCircuit_tran.txt v(Vin) v(Vout) 
destroy all
reset

exit
.endc
.END

The logs are:

Ngspice started...
Warning: singular matrix:  check nodes l2#branch and l2#branch

Note: Starting dynamic gmin stepping
Trying gmin =   1.0000E-03 Note: One successful gmin step
Trying gmin =   1.0000E-04 Note: One successful gmin step
Trying gmin =   1.0000E-05 Note: One successful gmin step
Trying gmin =   1.0000E-06 Note: One successful gmin step
Trying gmin =   1.0000E-07 Note: One successful gmin step
Trying gmin =   1.0000E-08 Note: One successful gmin step
Trying gmin =   1.0000E-09 Note: One successful gmin step
Trying gmin =   1.0000E-10 Note: One successful gmin step
Trying gmin =   1.0000E-11 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Warning: singular matrix:  check nodes l2#branch and l2#branch

Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to   0.0000% Warning: singular matrix:  check nodes l2#branch and l2#branch


Trying gmin =   1.0000E-02 Note: One successful gmin step
Trying gmin =   1.0000E-03 Note: One successful gmin step
Trying gmin =   1.0000E-04 Note: One successful gmin step
Trying gmin =   1.0000E-05 Note: One successful gmin step
Trying gmin =   1.0000E-06 Note: One successful gmin step
Trying gmin =   1.0000E-07 Note: One successful gmin step
Trying gmin =   1.0000E-08 Note: One successful gmin step
Trying gmin =   1.0000E-09 Note: One successful gmin step
Trying gmin =   1.0000E-10 Note: One successful gmin step
Trying gmin =   1.0000E-11 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Note: One successful source step
Supplies reduced to   0.1000% Warning: singular matrix:  check nodes l2#branch and l2#branch

Supplies reduced to   0.0000% Warning: singular matrix:  check nodes l2#branch and l2#branch

Warning: source stepping failed

Circuit: * qucs 0.0.19  /home/eduardo/projetosimoes/qucs/initialcircuit.sch

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000


Transient solution failed -

Last Node Voltages
------------------

Node                                   Last Voltage        Previous Iter
----                                   ------------        -------------
_net0                                   1.74481e-22          6.32215e-27
_net1                                   1.74481e-22          6.32215e-27
vout                                   -9.83511e-33         -1.26443e-26
vin                                               0                    0
l1#branch                               8.92061e-35                    0
l2#branch                                         0                    0
v1#branch                                         0                    0


doAnalyses: iteration limit reached

tran simulation(s) aborted
Error(parse.c--checkvalid): vin: no such vector.
ngspice-26 done

The schematic is:

Circuit

\$\endgroup\$
2
  • \$\begingroup\$ Try putting a 0.001 ohm resistor in series with the transformer primary (this sort of thing has happened before to me). Also, shift the ground connection from the primary to the DC secondary - if you need to monitor the primary voltage you can use a VCVS to buffer that 1:1 to the secondary side as a signal. Vout cannot be "measured" without earth at the DC secondary. \$\endgroup\$
    – Andy aka
    Commented Jun 9, 2020 at 18:43
  • \$\begingroup\$ @Andyaka adding the resistor to the transformer pimary and GND to both sides worked. But the Vout measurement is still not the one expected. Any thoughts. I'm really newbie to circuit simulation. \$\endgroup\$ Commented Jun 9, 2020 at 18:59

1 Answer 1

1
\$\begingroup\$

It turns out I needed to add GND to the second part and add a little resistor to simulate the transformer primary resistance.

The soltion was:

Circuit

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.