# RC Discharge/Charging

For a normal RC circuit with one resistor and one capacitor, let say at $t=0$ the switch closes and complete the circuit. All components are connected. voltage source (VA), $R$ and $C$.

If C was initially charged to let say a voltage value of -VC(initially) before the switch even closed to complete the circuit and now when $t=0$ the source is trying to charge the capacitor as VA > -VC(initially)

1. Wouldn't the capacitor have to discharge to zero voltage first before it can be charged up to the source voltage?

2. How does the discharge of the capacitor and the charging work at the same time? I can't visualize the concept of how that work. Where does the energy go?

To my understand,

q=c*v; I=dq/dt

E - IR - V(c) =0

E- (dq/dt)R - q/c =0 Solving the DE equation: Vc(t) = Vf (1-e^-1/RC); where vf is when the capacitor has been charged for long time and it is now act as an open circuit. No current flow, which mean the resistor voltage is zero and the sum of the voltage drop across the circuit is now just E = Vf (final voltage across the capacitor equal to the source).

I(t) = Io*e^(-t/RC);

the Io (I initial) is when t=0 the switch just closed. The charge across the capacitor is still zero as it can't change instantaneously. therefore, the initial current Io is just the Io=E/R. However this is not what we have in this case.

Wouldn't the capacitor have to discharge to zero voltage first before it can be charged up to the source voltage?

Yes.

How does the discharge of the capacitor and the charging work at the same time?

It doesn't work at the same time; the capacitor is either supplying energy to the circuit (discharging) or receiving energy from the circuit (charging).

I can't visualize the concept of how that work. Where does the energy go?

As I've written here and at the EE stackexchange site, the general solution for the switched RC circuit is (for $t \ge 0$)

$$v_C(t) = V_S + \left[v_C(0) - V_S\right]e^{-t/RC}$$

where $V_S$ is the source voltage and $v_C(0)$ is the initial capacitor voltage. The capacitor current is then

$$i_C(t) = C\frac{dv_C}{dt} = \frac{1}{R}\left[V_S - v_C(0)\right]e^{-t/RC}$$

The instantaneous power delivered to the capacitor is then

$$p_C(t) = v_C(t) \cdot i_C(t) = \frac{V_S}{R}\left[V_S - v_C(0)\right]e^{-t/RC} - \frac{\left[v_C(0) - V_S\right]^2}{R}e^{-2t/RC}$$

Now, let $v_C(0)$ (the initial capacitor voltage) be negative. Note carefully that the power delivered to the capacitor is initially negative, crosses zero, reaches a maximum positive value, and then decays to zero.

When the power is negative, the capacitor is discharging, supplying energy to the circuit (the resistor receives the energy initially stored in the capacitor). When the power is positive, the capacitor is charging, receiving energy from the circuit.

To get a feel for how this capacitor power equation works, follow the link to a Desmos Graphing Calculator page that I created

For further work, use the capacitor power formula above to see what happens if the capacitor voltage is initially greater than the source voltage.

Could you link where you derived your general equation for RC circuit?

Easier to just derive it here than to search for it.

KVL:

$$v_R = V_S - v_C$$

Ohm's Law:

$$i = \frac{V_S - v_C}{R}$$

Capacitor equation:

$$i = C\frac{dv_C}{dt}$$

$$\Rightarrow \frac{dv_C}{dt} + \frac{1}{RC}v_C = \frac{V_S}{RC}$$

Homogeneous solution:

$$v_C(t) = Ae^{-t/RC}$$

Particular solution:

$$v_C(t) = V_S$$

$$\Rightarrow v_C(t) = V_S + Ae^{-t/RC}$$

$$v_C(0) = V_S + A \rightarrow A = v_C(0) - V_S$$

$$\therefore v_C(t) = V_S + \left[v_C(0) - V_S \right]e^{-t/RC}$$

• Could you link where you derived your general equation for RC circuit? I've edited my post with my own understanding of the derivation. Jun 19, 2017 at 0:53
• @Ace8888, I updated my answer with a derivation Jun 19, 2017 at 1:27
• for the current eq. let say we have RC value of 1sec and it takes roughly 5Tau for the capacitor to reach steady state so in 5 secs the capacitor will reach steady state. If i use the current equation and plug in 5 secs (as it is the time for the steady state), i would get an value even know i know this is not correct since when steady state is reached, there is no current flows. The capacitor charges oppose any current movement. Thoughts? Jun 20, 2017 at 2:54

If the capacitor is charged to a voltage of -V, and after closing the circuit it ends up with a charge of +V, then it will indeed first "discharge" (that is, the voltage across the terminals goes from -V to +V, and hass to cross through 0. At that moment there will be no net charge on the capacitor).

You ask "where does the energy go?". The answer: it goes into the resistor. When you first close the switch, there is a voltage of 2V across the resistor, and the current will be $I=2V/R$. The power generated in the resistor will be $(2V)I = 4V^2/R$, but the battery is only supplying a power of $VI$ - half of the power. The other half of the power comes from the capacitor that is discharging.

As the charging process continues, there comes a point where the voltage on the capacitor is zero; at that point, the current is $I=V/R$ and all the power in the resistor is provided by the battery. When the capacitor begins to reach a positive charge, the current drops further and the power in the resistor is now less than the energy provided by the battery; the remaining energy goes into the capacitor according to $E = \frac12 CV^2$ where $C$ is the capacitance, and $V$ is the voltage across the terminals of the capacitor.

You might find it a good exercise to write down the voltages and currents as a function of time, and convince yourself that the qualitative analysis I provided above (which I did deliberately to guide your intuition) can indeed be turned into a quantitative result.

• where did you get the 2V from? Jun 19, 2017 at 2:58
• The voltage from the battery gives V minus the voltage of the capacitor. With the capacitor at -V the total voltage across the resistor is 2V. Jun 19, 2017 at 3:06

Whatever the initial condition of the capacitor, the end result is that it will be charged to the same voltage as the source. The graph in the middle shows how the voltage on the capacitor varies with time after connection to the voltage source.

Taking voltage as +ve when the plate on the left is +ve (the same as the source), if the capacitor is initially charged to a greater voltage than the source $(V \gt V_0)$ then the capacitor will discharge through the source (following the decay curve), exponentially towards $V_0$. Otherwise $(V \lt V_0)$ it will charge up to the voltage of the source (following the growth curve).

If initially $V \lt 0$ (ie the -ve plate is on the left) then the capacitor voltage will pass through $0$ on its way up to $V_0$ on the growth curve.

In no case does the capacitor charge or discharge exponentially to zero first then charge up again from zero voltage.

For example, if the capacitor voltage starts at $V_1$ where $0<V_1<V_0$ then it continues from P upwards towards $V_0$ along the growth curve. It does not follow a decay curve down to $0$ then a growth curve up to $V_0$, as in the graph on the right.

So I think that your second question does not require an answer.

• In case one, the capacitor initially charged to a greater voltage and like terminals are connected. The higher potential of the capacitor will create charges flow, from the positive terminal of the capacitor to the positive of the source, which is less than the initially charged value of capacitor. The extra positive electrons in the voltage source will repel the positive electrons in the negative terminal and force it to move to the capacitor negative charged terminal. Convention sign was use to visualize this. Could you please elaborate on the 2nd case. Jun 18, 2017 at 21:48
• 2nd case where initial charge of the capacitor is less than the source and its connected in opposite terminal. Also, how would we take account for the initial opposite charge of the capacitor in this case? like to relate the discharge and charging equation to account for this 2nd case Eq1 Vc(t) = Vi*e^-t/RC and Eq1 Vc(t) = Vf*(1-e^-t/RC). Thanks! Jun 18, 2017 at 21:49
• Not sure of your definition of "discharge" but if the capacitor starts with $-Q$ and goes through 0 charge, that's my definition of "discharging" (and indeed, that seems to be OP's definition as well). Jun 18, 2017 at 22:03
• "In no case does the capacitor charge or discharge exponentially to zero first then charge up again from zero voltage" - I see what you're saying but it is a 'funny' way to put it. A capacitor is discharging when the capacitor power is negative regardless of the shape of the voltage curve. Jun 19, 2017 at 0:22