RC circuit (time constant)
A capacitor charges through a resistor fast at first, then ever more slowly: the closer it gets to the supply voltage, the less is left to push current through the resistor. After one time constant it is 63% charged, and the same curve, mirrored, empties it again.
The formulas
- Time constant: τ = R × C (ohms × farads = seconds).
- Charging from empty: VC(t) = Vs (1 − e−t/τ). Time to reach a fraction f of the supply: t = −τ ln(1 − f), so 99% takes about 4.6 τ.
- Discharging from V0: VC(t) = V0 e−t/τ.
- Current at the start: Vs ÷ R. Stored when full: charge Q = C Vs and energy ½ C Vs².
Ideal parts: no leakage in the capacitor and no resistance in the supply or wires. The animation charges for 5 τ, then discharges for 5 τ, and runs that in 6 seconds however long it really takes. Tested: the formulas against stepping the circuit equation dV/dt = (Vs − V) ÷ RC numerically (packages/mechanics/test/science.test.ts).
Example
With resistance 10 kΩ, capacitance 100 µF, supply 9 V: time constant τ = RC: 1 s; time to 99%: 4.61 s; current at the start: 900 µA; energy stored when full: 4.05 mJ; charge when full: 900 µC. Open this setup, then change one thing at a time.
Related: Voltage divider · Spring–mass–damper · Tank drain time