Electronic – Singular error when putting a current source in series with a capacitor (ngspice)

capacitorltspicespice

I am getting singular errors when I simulate a current source in series with a capacitor with the following .cir file:

* Spice netlister for gnetlist
C1 1 0 1
I1 1 0 1
.TRAN 100u 6m

(I understand a farad is huge, just to make the numbers easy. I have tried smaller capacitor values, but they have not helped.)

Based on my analysis,

I = C*(dV/dt)

Integrating, I expect

V = (I*t)/C.

So I would expect increasing voltage in the mV range over time when I plot v(1), but I get the following error at the below of this message. When I change the C1 into an R1, no error is observed at all. What is going on?

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Warning: singular matrix:  check nodes 1 and 1

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 1 and 1

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


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 1 and 1

Supplies reduced to   0.0000% Warning: singular matrix:  check nodes 1 and 1

Warning: source stepping failed

Transient solution failed -

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

Node                                   Last Voltage        Previous Iter
----                                   ------------        -------------
1                                                 0                    0


doAnalyses: iteration limit reached

run simulation(s) aborted

Best Answer

Many circuit simulators attempt to find a DC operating point prior to executing a transient analysis. Basically, they replace inductors with short circuits and capacitors with open circuits and then solve the remaining circuit.

Your circuit has no stable DC point (open-circuit current source) and this process fails. Usually, there's a way to tell the simulator to skip the initialization step and specify starting conditions (e.g., Vcap = 0V) explicitly.