Physics · Simulator 016
Flip a switch to charge a capacitor through a resistor, then flip it back to discharge it. Change the resistance, capacitance and supply voltage, and watch the exponential curves and the time constant τ = RC.
When the switch connects the battery, current flows through the resistor and charge builds on the capacitor. As the capacitor voltage rises, the voltage across the resistor falls, so the current drops:
charging: V_C(t) = V₀ (1 − e^(−t/τ)), I(t) = (V₀/R) e^(−t/τ)
discharging: V_C(t) = V_start · e^(−t/τ), I(t) = −(V_start/R) e^(−t/τ)
τ = R·C
After one time constant the capacitor reaches 63.2% of its final voltage when charging, or falls to 36.8% when discharging. After 5τ it is within 1% of the end value. Energy stored is ½CV². While charging from empty, the resistor dissipates exactly as much energy as the capacitor ends up storing, whatever R is.
The simulation integrates dV_C/dt = (V_source − V_C)/(RC) numerically, and you can flip the switch at any moment.
Ideal components: no internal resistance in the battery, no leakage in the capacitor, no wire inductance.
A camera flash charges a 220 µF capacitor to 300 V through a 4.7 kΩ resistor. How long until it is 99% charged? How much energy is then stored?
τ = 4700 × 220×10⁻⁶ ≈ 1.03 s. 99% needs t = τ ln(100) ≈ 4.6τ ≈ 4.8 s. Energy: ½ × 220×10⁻⁶ × 300² ≈ 9.9 J, released in about a millisecond through the flash tube.