Sub topic 12
Charging and discharging through a resistor
This chapter covers what happens when a capacitor is charged or discharged through a resistor, the time constant that sets the pace, and the energy bookkeeping. It assumes you know C = Q/V, the energy U = ½CV², Ohm's law, and Kirchhoff's loop rule. It also assumes you can integrate simple exponentials.
Why the current is not constant
Connect an uncharged capacitor C, a resistor R, a battery of EMF V and a switch in series. When you close the switch, the capacitor has no voltage across it. The battery's full EMF therefore appears across the resistor, and the initial current is V/R.
As charge builds up on the plates, the capacitor develops its own voltage q/C, which opposes the battery. The voltage left across the resistor shrinks, so the current falls. Charging ends when the capacitor voltage equals V and the current reaches zero.
Two limiting behaviours are worth memorising:
- At t = 0 an uncharged capacitor acts like a wire (a short circuit). The current is limited only by R.
- At t → ∞ a charged capacitor acts like a break in the circuit (an open circuit). No steady current flows through its branch.
Charging: deriving the equations
Apply the loop rule around the series circuit, with q the charge on the capacitor at time t and i = dq/dt the current:
V − iR − q/C = 0
Substitute i = dq/dt and rearrange:
R dq/dt = V − q/C = (CV − q)/C
Separate the variables:
dq/(CV − q) = dt/(RC)
Integrate from q = 0 at t = 0 to q at time t:
−ln[(CV − q)/(CV)] = t/(RC)
Solving for q gives:
q(t) = CV (1 − e^(−t/RC))
Differentiate to get the current:
i(t) = dq/dt = (V/R) e^(−t/RC)
The capacitor voltage is vC = q/C = V(1 − e^(−t/RC)), and the resistor voltage is vR = iR = V e^(−t/RC). The two always add up to V.
The time constant
The quantity τ = RC is the time constant. It has units of time, because ohm × farad = (V/A)(C/V) = C/A = s. Its meaning is practical:
| Time | Charge as a fraction of CV | Current as a fraction of V/R |
|---|---|---|
| t = 0 | 0 | 1 |
| t = τ | 1 − e⁻¹ ≈ 0.632 | e⁻¹ ≈ 0.368 |
| t = 2τ | 1 − e⁻² ≈ 0.865 | e⁻² ≈ 0.135 |
| t = 3τ | 1 − e⁻³ ≈ 0.950 | e⁻³ ≈ 0.050 |
| t = 5τ | 1 − e⁻⁵ ≈ 0.993 | e⁻⁵ ≈ 0.007 |
Charging never finishes in finite time, but after about 5τ the capacitor is within 1% of its final charge. Another useful fact: the initial slope of q(t) is CV/τ, so the tangent at t = 0 would reach the final value CV exactly at t = τ.
import math
def charging_charge(t, C, V, R):
return C * V * (1 - math.exp(-t / (R * C)))
def charging_current(t, C, V, R):
return (V / R) * math.exp(-t / (R * C))
R, C, V = 1e3, 1e-6, 10.0
tau = R * C
for n in (0, 1, 2, 3, 5):
t = n * tau
q_frac = charging_charge(t, C, V, R) / (C * V)
i_frac = charging_current(t, C, V, R) / (V / R)
print(f"t = {n} tau: q/CV = {q_frac:.3f}, i/(V/R) = {i_frac:.3f}")The program reproduces the table above.
Discharging: deriving the equations
Now take a capacitor carrying charge Q0 = CV0 and connect it across a resistor R, with no battery. The loop rule gives:
−iR + q/C = 0 with i = −dq/dt
Here the current is the rate at which the charge decreases, so the sign is negative. Then:
dq/dt = −q/(RC)
Integrating from Q0 at t = 0:
q(t) = Q0 e^(−t/RC)
The current magnitude is:
i(t) = (Q0/RC) e^(−t/RC) = (V0/R) e^(−t/RC)
After one time constant the charge has fallen to 36.8% of its starting value. The decay is exponential, so the charge drops by the same factor in every equal time interval. The half-life is t½ = RC ln 2 ≈ 0.693 RC.
Energy balance during charging
Here is the key conservation question for JEE. Track three energies while the capacitor charges from 0 to CV.
- The battery does work W = ∫ V i dt = V × (total charge moved) = V × CV = CV².
- The capacitor stores U = ½CV².
- The resistor dissipates heat H = ∫ i²R dt.
Compute the heat directly:
H = ∫₀^∞ (V/R)² e^(−2t/RC) R dt = (V²/R)(RC/2) = ½CV²
So the energy splits exactly in half: ½CV² is stored and ½CV² is lost as heat. The check is W = U + H, so CV² = ½CV² + ½CV².
For discharging, the battery is absent. All the stored energy ½CV0² turns into heat in the resistor, which you can confirm with ∫ i²R dt using the discharge current.
If the capacitor already holds charge when you connect it to a battery, the numbers change. Suppose it goes from voltage V1 to V2 (both set by the same EMF direction). The battery supplies W = V × ΔQ = V C (V2 − V1), the stored energy changes by ½C(V2² − V1²), and the heat is the difference. For a battery of EMF V charging fully from V1 to V, the heat is ½C(V − V1)².
def charging_energy(C, V):
work = C * V**2
stored = 0.5 * C * V**2
heat = work - stored
return work, stored, heat
work, stored, heat = charging_energy(1e-6, 10.0)
print(work, stored, heat) # 1e-4 5e-5 5e-5Worked example
A 2 µF capacitor is charged through a 500 kΩ resistor from a 12 V battery. Find the time constant, the time to reach 90% of the final charge, and the heat produced.
- τ = RC = (5 × 10⁵ Ω)(2 × 10⁻⁶ F) = 1.0 s.
- Set 1 − e^(−t/τ) = 0.90, so e^(−t/τ) = 0.10 and t = τ ln 10 ≈ 2.30 s.
- Heat H = ½CV² = ½(2 × 10⁻⁶)(144) = 1.44 × 10⁻⁴ J.
Circuits with more than one resistor or capacitor
Most JEE problems use a more complicated circuit but reduce to one RC loop. The method:
- Find the behaviour at t = 0. Treat every uncharged capacitor as a wire and every capacitor holding a known charge as a battery of voltage q/C.
- Find the behaviour at t → ∞. Treat every capacitor as an open circuit, so no current flows in its branch.
- For the time dependence, find the Thevenin equivalent seen by the capacitor: the equivalent resistance Req with the sources turned off (batteries replaced by wires), and the open-circuit voltage Vth. Then:
q(t) = C Vth − (C Vth − q0) e^(−t/(R_eq C))
where q0 is the initial charge. Capacitors that are directly in parallel or series can be replaced by an equivalent capacitance first, as in the earlier chapter on combinations.
For the final steady state, the capacitor voltage equals the voltage between the two points it connects when no current flows through it. This is often the quickest route to the final charge.
import math
def rc_general(t, C, v_final, v_initial, R_eq):
# capacitor voltage relaxes exponentially from v_initial to v_final
return v_final + (v_initial - v_final) * math.exp(-t / (R_eq * C))
# 1 uF capacitor, R_eq = 2 kohm, final voltage 6 V, starting at 2 V
print(rc_general(2e-3, 1e-6, 6.0, 2.0, 2e3)) # one tau later: about 4.53 VOne formula covers charging, discharging and partial charging. Charging has vinitial = 0, and discharging has vfinal = 0.
Common errors
- Using the resistor in the wrong direction of thinking: the current is largest at the start of charging, not at the end.
- Forgetting that the time constant uses the equivalent resistance seen by the capacitor, with ideal batteries treated as zero resistance.
- Claiming that the battery's work equals the stored energy. The battery gives CV², and only half of it is stored.
- Applying the ½CV² heat result to a capacitor that is already charged. Use ½C(ΔV)² for a step ΔV in the source voltage.
- Treating the capacitor as a wire at t → ∞. At steady state it is an open circuit.
- Mixing up charge and current exponentials: q rises as 1 − e^(−t/τ) while charging, but i falls as e^(−t/τ).
Exercise
A 5 µF capacitor, initially uncharged, is connected in series with a 200 kΩ resistor and a 20 V battery. (a) What is the initial current? (b) How long does it take for the charge to reach half of its final value? (c) How much heat is produced in the resistor by the time charging is complete?
Show answer
(a) At t = 0 the capacitor voltage is zero, so i = V/R = 20 / (2 × 10⁵) = 1.0 × 10⁻⁴ A = 0.1 mA. (b) τ = RC = (2 × 10⁵)(5 × 10⁻⁶) = 1.0 s. Half charge means 1 − e^(−t/τ) = 0.5, so t = τ ln 2 ≈ 0.693 s. (c) Heat = ½CV² = ½(5 × 10⁻⁶)(400) = 1.0 × 10⁻³ J = 1 mJ. The battery supplies CV² = 2 mJ, and half of that is stored.
Exercise
A 10 µF capacitor charged to 50 V discharges through a 100 kΩ resistor. After how long is the capacitor voltage 10 V, and how much energy has been dissipated by then?
Show answer
τ = (10⁵)(10⁻⁵) = 1.0 s. The voltage decays as v = 50 e^(−t/τ), so 10 = 50 e^(−t/τ) and t = τ ln 5 ≈ 1.61 s. Initial energy is ½(10⁻⁵)(2500) = 1.25 × 10⁻² J. Remaining energy is ½(10⁻⁵)(100) = 5 × 10⁻⁴ J. The dissipated energy is 1.25 × 10⁻² − 5 × 10⁻⁴ = 1.2 × 10⁻² J, which is 12 mJ.