#17 Capacitor simulation problems


I am running a very simple RC circuit whose netlist is quoted below:

Test circuit
V0 n1 GND DC 10V
R1 n1 n2 3.3k
C2 n2 GND 47uF

However, when I plot for the voltage of the capacitor I get no charging curve. Instead I get a plotted result as if the capacitor instantly took its fully charged voltage value. I have tried several timesteps and capacitances and this problem is not solved. I am using revision 23 of ngspice.

The plot looks like this: http://i.imgur.com/q1I2s.png


    • status: open --> open-accepted
  • Perhaps it is a bug but by adding the missing initial condition (IC=0V) and adding the simulation command (.tran 100u 1 uic) the result is OK. The question is if the use initial conditions (UIC) option for the transient command should be initiated automatically or not.
    Thanks for the report,

  • marcel hendrix
    marcel hendrix

    From my experience with LTSPice, Dietmar's assumption is quite probably correct (initial conditions are activated when the UIC option for .TRAN is given).

    The SPICE 3f3 manual (www.thedigitalmachine.net/reference/Spice_3f3_Users_Manual.pdf) says:

    "The (optional) initial condition is the initial (time-zero) value of capacitor voltage (in Volts). Note that the initial conditions (if any) apply ’only’ if the UIC option is specified on the .TRAN control line."


    • priority: 5 --> 3
  • Yes, from practical point of view seems the automatic UIC activation reasonable if an element has an IC. But as you found the spice3 manual the dependency is vice versa. And it is to consider if we have an op analysis befor or not.
    So I changed the status from bug to feature request and decreased the priority until further discussion results.