I built a basic schema with resistor, capacitor, ground and a battery in LTspice and MicroCap. I used transient analysis mode.

I expected to see on a plot showing decreasing current and increasing voltage during launch eventually stabilising at 0A. For the voltage I was expecting the opposite (starting out at 0V and stabilising at Vbat), but I only get flat lines where capacitor voltage is equal to battery voltage from t = 0 and current 0A.

I wanted to prove time to charge rule for capacitor where T = 5RC.

I played with various time ranges and time steps but no luck.

What I am doing wrong?


2 Answers 2


For LTSpice, you'll want to add an initial condition for the cap. There are multiple ways to do this, the simplest is to modify the part value like so:

enter image description here

On a cap the ic set the initial voltage. On an inductor is sets the initial current. You can also specify node voltages etc. ltwiki topic on initial conditions has more details.

  • \$\begingroup\$ Thanks. It works. Default behavior is not intuitive, because in reality nobody charges my capacitors if I would experiment with a real oscilloscope. I am curious why team made such decision cause it makes entry level higher. Lot's of beginners probably resigned from the app because of this feature. \$\endgroup\$ Nov 26, 2019 at 2:30

By default LTspice starts the simulation with capacitors charged to the steady state voltage. Here are some ways to make it start discharged.

  1. In 'Edit Simulation Command' select the option 'start external DC supply voltages at 0V', or add 'startup' to the .trans directive.

  2. Make the battery into a 'pulse' voltage starting at 0V and going to its normal voltage after a short time delay.

  3. Wire a switch or transistor across the capacitor and momentarily turn it on with a voltage pulse.


Your Answer

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

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