loading...
running...
How to use
Pick a preset, then adjust R, L, C and the source. Watch the scope for vC, vR, vL and the source, the resonance curve for where the drive frequency sits relative to f0, and the energy graph for the swap between capacitor and inductor. Use the time base and speed sliders to zoom in time. Drag to orbit, wheel to zoom. Space pauses, R restarts. Re-run the numerical checks at the bottom.
The bench, resistor, coil, capacitor, generator and oscilloscope were modelled and baked in Blender; Three.js r160 animates the charge carriers and draws the live scope screen from the same RLC model as the 2D lab.
The science
A series RLC loop obeys Kirchhoff's voltage law, with the current i = dq/dt shared by all three parts:
L di/dt + R i + q/C = vs(t) i.e. q'' + 2α q' + ω0² q = vs/L, α = R/2L, ω0 = 1/√(LC)
The damping ratio ζ = α/ω0 = (R/2)√(C/L) sets three regimes. ζ < 1: the charge rings at ωd = √(ω0² − α²) inside an envelope e−αt, and a DC step overshoots by exp(−πζ/√(1−ζ²)). ζ = 1 (R = 2√(L/C)) is critical damping, the fastest return without overshoot. ζ > 1 decays as a sum of two exponentials.
AC drive. In the steady state the amplitude is I = V0/|Z| with |Z| = √(R² + (ωL − 1/ωC)²) and the source leads the current by φ = arctan((ωL − 1/ωC)/R). Resonance at ω0 gives |Z| = R and a current peak whose sharpness is Q = ω0L/R; at resonance VL and VC are each Q times the source amplitude and cancel in the loop.
Energy. The inductor stores ½ L i², the capacitor q²/2C, and the resistor turns i²R into heat. The bookkeeping graph shows source work + initial capacitor energy = EL + EC + heat; the residual in the readout is the numerical error of the integrator.
Numerics and checks. The ODE is integrated with fourth-order Runge-Kutta at 400 steps per natural period. Checks against closed forms: (1) successive vC peaks fall by exp(−αTd), (2) the ringing period equals 2π/ωd, (3) the step-response overshoot, (4) critical damping never overshoots, (5) the AC peak current equals V0/|Z|, (6) energy conservation.
Simplifications. Ideal components: no coil resistance, no capacitor leakage or ESR, no radiation, constant L and C (no saturation), a perfect source with zero internal resistance. The carrier dots move by the charge that has flowed (q/C V0 of one dot spacing times three); real conduction electrons drift far more slowly than the signal propagates.