# Why doesn't this RC circuit simulate as expected? (i.e. what am I doing wrong?)

I am trying to learn about RC circuits. As I understand it, the indicated point in the basic RC circuit below should produce a current and voltage curve like this. However, when I attempt to simulate the circuit in the embedded CircuitLab and (other online simulators also) I get nothing. I also tried in Digikey's Partsim and got the same results. So it must be something I'm doing wrong...

I chose Time Domain simulation with the following parameters: (I assume the Time Constant for this circuit is about 1 second, so 2 sec should generate a nice curve...)

I'm measuring V and I at the point indicated.

Here's what I get. Notice the scale shows 9.000V top and bottom, and current 0.000A top and bottom. It makes no sense! Please tell me where I went wrong! Thank you! simulate this circuit – Schematic created using CircuitLab

• How did you define your source in the simulator?
– Big6
Aug 29, 2016 at 21:29
• Source is a voltage source, as you see in the drawing, set to 9V DC. Aug 29, 2016 at 21:30
• Skip Initial -> Yes Aug 29, 2016 at 21:34
• You have to make sure your input is a step, i.e, start from zero up to 9V. If you make it 9V (9V at time zero), then your simulation leaves out the transient part.
– Big6
Aug 29, 2016 at 21:36

The default initial conditions for time domain simulations is almost always the "steady-state" condition assuming all sources were at their $t=0$ state since $t=-\infty$.

There are a few different fixes for this:

1. Switch to a time dependent source (like what Jim did with a square wave source)
2. Disable the "initial condition" solve step, which usually initializes all nodal voltages/branch currents to 0 (when applicable). 1. Manually specify the initial conditions. Unfortunately, CircuitLab doesn't appear to allow you to do this (other than disabling the "skip initial" step). However, for SPICE-like simulators you can add an .ic command to manually specify the value to use. For example, here I've set the initial conditions V(out)=4V in LTSPICE.  • Enabling the "Skip Initial" by setting to Yes solved the issue for me. Thank you for this clarification. Now back to learning about RC circuits! Aug 30, 2016 at 2:46

Before starting the transient simulation, the simulator performs a DC analysis which concludes that the capacitor is fully charged so once the transient analysis starts, since your source doesn't change, the output doesn't move either.

The small movement you see in your first simulation waveform are probably due to a small numerical computation error difference between the DC and transient solvers. Once the transient solver "sees" an error it tries to correct for it in the subsequent time steps. Try zooming out your axes on the voltage and current to see how much those waveforms are actually moving by. My bet is that they are pegged at 9V and 0A respectively.

Try running it with a square wave input with a 4 second period, running it for 4 seconds total to see the entire period. simulate this circuit – Schematic created using CircuitLab • OK so that gave me this: snag.gy/F43JmN.jpg which makes more sense. The question is why doesn't it work with a 9VDC input? Does it assume everything is already at the working voltage? Why can't it show capacitor charge-up time for a DC source? Aug 29, 2016 at 21:28
• I'm not positive, but my understanding is that when you apply a DC source, the solver assumes it has been that voltage since time t = - ∞ which would mean the capacitor has already been charged. Which makes your output even more confusing.
– Jim
Aug 29, 2016 at 21:36
• Yup, that's the reason. Simulators almost always have a "skip initial operating point solution" option. But normally, they go and find that $t\rightarrow\infty$ solution first and apply it as the starting condition. That works really well, often. But for something like this, no. Also, you can use ".ic" to set the initial conditions on parts. So something like '.ic V(C1)=0" might be something do, along with skipping that operating point calc.
– jonk
Aug 29, 2016 at 22:30