EMDyna Sandbox Scene Details
Overview Manual & Theory Validation Suite Python API Gallery Open Simulator

← Back to Scene Gallery

OfficialBasicCharging and Discharging of a Capacitor (Time Constant of an RC Circuit)

The path of a battery (6 V) and switch S1, the path of a resistor R (1 kΩ) and capacitor C (100 µF), and the path of switch S2 are connected in parallel between two points on the left and right. Initially, only S2 is closed, and the capacitor is empty. This is a scene from the classroom teaching material "Charging and Discharging of a Capacitor" (/classroom). [Highlights] - Opening S2 and closing S1 charges the capacitor. In the waveform at the bottom, the capacitor voltage approaches 6 V, and the current approaches 0 from the initial 6 mA (V/R). - The time it takes for the voltage to reach 63% of 6 V (approx. 3.8 V) is the time constant τ = RC (1 kΩ × 100 µF = 0.1 s). By placing two cursors using "Zoom" on the waveform, you can read the time difference Δt. - Clicking on the resistor or capacitor to change R or C changes the time constant in proportion to RC. - Opening S1 and closing S2 discharges the capacitor through R, and the voltage approaches 0 with the same time constant. - Clicking ⏮ "From Beginning" resets the capacitor to the empty state.

Oct 27, 2026 • 30 views

Launch & Remix in Simulator

Read the explanation, with equations and figures ↓

Modify this scene in the simulator, then open the "Scene" tab and click "Publish Current Scene to Gallery" to share your remix!

·

In short

A capacitor stores electric charge like a tiny rechargeable battery. In this circuit, a battery charges a capacitor through a resistor, and a switch lets it discharge.

What you are looking at

A classic RC transient circuit demonstrating the exponential charging and discharging behavior of a capacitor through a series resistor:

  • A DC battery with electromotive force V0=6 VV_0 = 6\text{ V} and knife switch S1\text{S}_1 in the upper branch.
  • A resistor R=1 kΩR = 1\text{ k}\Omega (1000 Ω1000\ \Omega) and capacitor C=100 μFC = 100\ \mu\text{F} in series in the lower branch.
  • A bypass knife switch S2\text{S}_2 in the middle branch.
  • The oscilloscope displays real-time voltage and current waveforms across the capacitor:
  • Capacitor voltage VC(t)V_C(t): approaches 6 V6\text{ V} during charging and drops to 0 V0\text{ V} during discharging.
  • Loop current I(t)I(t): surges instantaneously to V0/R=6 mAV_0/R = 6\text{ mA} and decays asymptotically toward zero.

Initially, switch S2\text{S}_2 is closed and S1\text{S}_1 is open, keeping the capacitor completely uncharged (Q=0Q = 0). Opening S2\text{S}_2 and closing S1\text{S}_1 charges the capacitor. Opening S1\text{S}_1 and closing S2\text{S}_2 discharges it through resistor RR.

Parametric dependencies

Parameter changedEffect on time constant τ=RC\tau = RCEffect on peak current Ipeak=V0/RI_{\text{peak}} = V_0 / REffect on final stored energy UEU_E
Increase resistance RRIncreases proportionallyDecreases inverselyUnchanged
Increase capacitance CCIncreases proportionallyUnchangedIncreases proportionally
Increase battery voltage V0V_0UnchangedIncreases proportionallyIncreases quadratically (V02V_0^2)

Theory of RC transient response

1. Capacitor charging transient

Applying Kirchhoff's voltage law around the charging loop:

V0−RI(t)−VC(t)=0V_0 - R I(t) - V_C(t) = 0

Since the current entering the capacitor is related to its accumulated charge by I(t)=dQdt=CdVCdtI(t) = \frac{dQ}{dt} = C \frac{dV_C}{dt}:

RCdVCdt+VC(t)=V0R C \frac{dV_C}{dt} + V_C(t) = V_0

Solving this first-order ordinary differential equation with the initial condition VC(0)=0V_C(0) = 0:

VC(t)=V0(1−e−t/τ)V_C(t) = V_0 \left(1 - e^{-t / \tau}\right)
I(t)=V0Re−t/τI(t) = \frac{V_0}{R} e^{-t / \tau}

where τ\tau is the characteristic time constant of the circuit:

τ=RC=1000 Ω×100×10−6 F=0.1 s=100 ms\tau = R C = 1000\ \Omega \times 100 \times 10^{-6}\text{ F} = 0.1\text{ s} = 100\text{ ms}

At time t=τt = \tau:

  • The capacitor voltage reaches 1−e−1≈63.2%1 - e^{-1} \approx 63.2\% of its final value: $$V_C(\tau) = 6\text{ V} \times 0.6321 \approx 3.79\text{ V}$$
  • The charging current decays to e−1≈36.8%e^{-1} \approx 36.8\% of its peak value: $$I(\tau) = 6\text{ mA} \times 0.3679 \approx 2.21\text{ mA}$$

After five time constants (t=5τ=0.5 st = 5\tau = 0.5\text{ s}), VC≈0.993V0V_C \approx 0.993 V_0, and the capacitor is practically fully charged with steady current I≈0I \approx 0.

2. Capacitor discharging transient

Opening S1\text{S}_1 and closing S2\text{S}_2 isolates the battery and forms a closed loop between the charged capacitor and resistor RR. Kirchhoff's voltage law yields:

RI(t)+VC(t)=0  ⟹  RCdVCdt+VC(t)=0R I(t) + V_C(t) = 0 \implies R C \frac{dV_C}{dt} + V_C(t) = 0

Given the initial fully-charged state VC(0)=V0V_C(0) = V_0:

VC(t)=V0e−t/τV_C(t) = V_0 e^{-t / \tau}
I(t)=−V0Re−t/τI(t) = -\frac{V_0}{R} e^{-t / \tau}

The discharge process exhibits the identical time constant τ=RC=0.1 s\tau = R C = 0.1\text{ s}. The negative sign indicates that current flows in the opposite direction through the resistor as stored charge leaves the capacitor plates.

3. Energy balance and Joule heat

The total electrical energy supplied by the DC battery during complete charging is:

Wsource=∫0∞V0I(t) dt=V0∫0∞V0Re−t/τ dt=V02C=62×100×10−6=3.6 mJW_{\text{source}} = \int_0^\infty V_0 I(t)\, dt = V_0 \int_0^\infty \frac{V_0}{R} e^{-t/\tau}\, dt = V_0^2 C = 6^2 \times 100 \times 10^{-6} = 3.6\text{ mJ}

The electrostatic potential energy stored in the electric field between the capacitor plates at full charge is:

UE=12CV02=12×100×10−6×62=1.8 mJU_E = \frac{1}{2} C V_0^2 = \frac{1}{2} \times 100 \times 10^{-6} \times 6^2 = 1.8\text{ mJ}

The energy dissipated as Joule heat in resistor RR is:

Wheat=∫0∞RI2(t) dt=RV02R2∫0∞e−2t/τ dt=V02R×τ2=12CV02=1.8 mJW_{\text{heat}} = \int_0^\infty R I^2(t)\, dt = R \frac{V_0^2}{R^2} \int_0^\infty e^{-2t/\tau}\, dt = \frac{V_0^2}{R} \times \frac{\tau}{2} = \frac{1}{2} C V_0^2 = 1.8\text{ mJ}

Remarkably, exactly 50%50\% of the energy delivered by the battery is stored in the capacitor, while the other 50%50\% is unconditionally dissipated as heat in the resistor, completely independent of the value of resistance RR.

Simulation measurements

Time constant verification (R=1 kΩR = 1\text{ k}\Omega, C=100 μFC = 100\ \mu\text{F}, τ=0.100 s\tau = 0.100\text{ s})

Elapsed time ttTheoretical VC(t)V_C(t)Simulated VC(t)V_C(t)Theoretical I(t)I(t)Simulated I(t)I(t)
0.00 s0.00\text{ s} (t=0t = 0)0.00 V0.00\text{ V}0.00 V0.00\text{ V}6.00 mA6.00\text{ mA}6.00 mA6.00\text{ mA}
0.10 s0.10\text{ s} (t=τt = \tau)3.79 V3.79\text{ V}3.79 V3.79\text{ V}2.21 mA2.21\text{ mA}2.21 mA2.21\text{ mA}
0.20 s0.20\text{ s} (t=2τt = 2\tau)5.19 V5.19\text{ V}5.19 V5.19\text{ V}0.81 mA0.81\text{ mA}0.81 mA0.81\text{ mA}
0.30 s0.30\text{ s} (t=3τt = 3\tau)5.70 V5.70\text{ V}5.70 V5.70\text{ V}0.30 mA0.30\text{ mA}0.30 mA0.30\text{ mA}
0.50 s0.50\text{ s} (t=5τt = 5\tau)5.96 V5.96\text{ V}5.96 V5.96\text{ V}0.04 mA0.04\text{ mA}0.04 mA0.04\text{ mA}

Try it

Comments