› Capacitor Energy Simulator Back
RC Circuit Simulator

Capacitor Charge/Discharge & Energy Simulator

Simulate RC circuit charging and discharging in real time. Plots voltage, current, and stored energy curves. Time constant τ, max energy U, and charge Q calculated automatically.

Parameters
Capacitance C
1 pF – 1000 μF (log scale)
Resistance R
1 Ω – 1 MΩ (log scale)
Supply voltage V₀
V
Initial voltage V_i
V
Mode
Results
—
Time constant τ = RC [s]
—
V at t=τ (63.2%) [V]
—
Max energy U = ½CV² [J]
—
Charge Q = CV₀ [C]
Live Capacitor Charge/Discharge (charge · field · energy)
Time t0 s
V_C(t)0 V
Current I0 A
Charge Q0 C
Energy U=½CV²0 J
% charged0 %
τ=RC—
elapsed0.0 τ
R C V₀ Charge RC circuit (Animation)
Voltage Vc vs Time
Capacitor Energy U
Theory & Key Formulas

Charging (initial voltage V_i, supply V₀):

$$V_C(t) = V_0 + (V_i - V_0)e^{-t/RC}$$

Discharging: $V_C(t) = V_i \cdot e^{-t/RC}$

Time constant: $\tau = RC$;  at $t=\tau$: $V_C \approx 0.632\,V_0$ (charging from 0)

Energy and charge: $U = \dfrac{1}{2}CV^2$,  $Q = CV$

RC charging, discharge and AC: equations and checked examples

🙋
In discharge mode, does stored energy use the 12V supply or the 3V initial voltage?
🎓
Use Vi=3V. A 100μF capacitor starts with Q=300μC and U=0.45mJ, not the 7.2mJ implied by 12V. With Vi=0, stored charge and energy are zero.

Checked calculation example

C=100μF, R=1kΩ, V0=12V, Vi=0: τ=0.1s and charging V(τ)=7.585V. The final charge is 1.2mC and energy 7.2mJ. Discharge starting at Vi=3V gives V(τ)=1.104V and initial energy 0.45mJ.

Model and scope

Ideal series RC circuit: τ=RC, Q=CVc, U=CVc²/2. Charging uses Vc=V0+(Vi−V0)exp(−t/τ); discharge uses Vc=Vi·exp(−t/τ). Positive current flows from source to capacitor. For Vs=V0sin(ωt), ω=2πf and x=ωτ, the exact transient solution is Vc=V0[sin(ωt)−xcos(ωt)]/(1+x²)+[Vi+V0x/(1+x²)]exp(−t/τ).

The C and R numeric inputs represent log10(C in F) and log10(R in Ω): −4 means 100μF; 3 means 1kΩ. DC plots show 5τ; AC plots show the first five periods. Five AC periods do not necessarily reach steady state. In AC, Q/U cards use the steady-state amplitude V̂c=V0/sqrt(1+x²), not the maximum over the initial transient. The t=τ card evaluates the actual AC solution.

Vi above V0 produces an initial current back toward the supply, even in charging mode. DC Q/U cards use the larger initial or asymptotic voltage. In discharge, V0 has no effect because the source is disconnected. The DC-only animation is hidden in AC; use the waveform plots. ESR, leakage, temperature effects, voltage ratings and component safety are outside this ideal model.

FAQ

Is capacitor voltage always 63.2% at one time constant?

Only for DC charging with Vi=0. Nonzero initial voltage gives V0+(Vi−V0)/e; discharge gives Vi/e. AC depends on frequency and the initial transient.

Does resistance change stored energy?

For a fixed final DC voltage, U=CV²/2 is independent of R. R changes the charging time. In AC it also changes the steady-state amplitude.

What happens when discharge starts at zero volts?

Vc, I, Q and U are zero. The supply voltage is not substituted for Vi.

Is the AC plot numerically integrated?

It uses the exact transient solution, sampled over five periods with 300 intervals. Current is I=(Vs−Vc)/R and energy is U=CVc²/2.

OpenStax: RC circuits