Electronic – RC circuit with a constant current source

capacitorcapacitor charging

I am trying to simulate a series RC circuit excited with a constant DC current source in LTSPICE. The expectation is that it should linearly charge the capacitor with a constant current flowing through it however what I am seeing in the simulation window is a zero or nearly zero(femto ampere) current always through the capacitor. Can you please help to understand where I am going wrong? Attaching images for my simulation.
P.S. I am using basic Capacitor in ltspice, no specific model from it's library.
Circuit diagram
Transient response

Best Answer

LTspice calculates the DC operating point before starting the transient simulation. If you check the capacitor voltage at the beginning of the simulation you'll probably find that it is 1GV. The capacitor voltage after a very long time would, in theory, increase without limit with a 1mA current source feeding into it and no parallel resistance, so the DC operating point makes no sense in this case.

If you name the node at the top of the capacitor Vcap and add an initial condition: .ic V(Vcap) = 0 as a spice directive you'll get a more sensible answer.

You can also set the initial condition for currents in inductors, which is useful in the analogous situation where a voltage source is connected across an inductor (though LTspice tries to save you from this by inserting a hidden default resistance of 1m\$\Omega\$ in series with the pure inductance). But if you start off with a 1V source across an inductor you'll still end up with a constant 1000A flowing rather than the linear increase of current with time you might have been expecting.