RLC Damping Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

Enter values and press Play.
Simulation summary will appear here.
Capacitor
Inductor
Loss

1. Real‑world phenomenon

Series resistor–inductor–capacitor (RLC) circuits appear in radios, motor drives, and countless electronic filters. When energy sloshes between the magnetic field of an inductor and the electric field of a capacitor, a resistor saps part of that energy as heat. The tug‑of‑war between storage and dissipation produces oscillations that gradually fade, a behavior called damping. Traditional calculators report the damping ratio or classify the response but stop short of showing the actual motion. This upgraded page keeps the original purpose—evaluating damping—but adds a fully fledged transient simulator. As you tweak component values or initial conditions, a dot oscillates across the canvas while striped bars track energy in the capacitor, inductor, and resistor. Watching the amplitude die away or persist makes the abstract algebra behind damping tangible.

RLC dynamics matter beyond textbook circuits. Car suspensions, seismographs, and even molecular vibrations follow mathematically equivalent equations. In electronics, damping influences signal overshoot, filter sharpness, and the tendency of power converters to ring after a sudden load change. Seeing the energy exchange in real time cultivates intuition for designing anything that trades between responsiveness and stability.

2. Variables and assumptions

The simulator models an ideal series loop consisting of resistance R, inductance L, and capacitance C. The capacitor starts with voltage V0 and the inductor with current I0. No external source drives the circuit; the animation shows the natural response after the switch is closed. We assume lumped components with constant values and neglect parasitic capacitances, core saturation, or frequency‑dependent resistance. All quantities use SI units. Input validation rejects non‑finite or negative values, and the time step Ī”t is clamped between 0.0001 and 0.1Ā s. The total run time T must exceed ten steps to ensure the plot has meaning.

Magnetic energy in the inductor is UL=12Li2, while electric energy in the capacitor is UC=12Cv2. Power dissipated in the resistor is P=i2R, which integrates to the gray ā€œLossā€ bar.

3. Governing equations

Applying Kirchhoff’s loop rule yields

Ldidt+Ri+qC=0

where q is the capacitor charge. Expressed in terms of capacitor voltage v=qC, the first‑order system becomes

didt=-Ri-vL,ā€ƒdvdt=iC

The undamped natural frequency and damping ratio follow

ω0=1LC,ā€ƒĪ¶=R2CL

Values of ζ below one produce decaying oscillations; equal to one gives critical damping; above one yields an overdamped response without oscillation. The caption reports ζ and ω0 for quick reference.

4. Numerical scheme

The code integrates the coupled equations using a fourth‑order Runge–Kutta (RK4) method, chosen for accuracy and stability. For state vector s=(i,v) and derivative function f, RK4 advances the solution by

(+Δt)=()+Δt6(1+22+23+4)

with 1=(), 2=(+21), and so on. The semi‑implicit nature of RK4 limits numerical energy drift compared with simple Euler methods. Stability is best when the time step satisfies Ī”t<LC20; the form warns if this guideline is violated.

Each step also accumulates dissipated energy Ud+=i2RΔt. The initial total energy U0 scales the energy bars so that the blue (capacitor) and orange (inductor) regions shrink as the gray loss bar grows.

5. Worked example

Consider R=10Ā Ī©, L=0.1Ā H, and C=0.001Ā F. The natural frequency is ω0=316.2Ā rad/s, and the damping ratio ζ=0.5, an underdamped case. Charging the capacitor to 5Ā V with zero current stores U0=12C52=0.0125Ā J of energy. Running the simulator with Ī”t=0.0005Ā s for T=0.1Ā s produces several oscillations whose envelope decays exponentially. The peak current reaches about 0.47Ā A, and by 0.1Ā s roughly half the initial energy has dissipated. Exporting the CSV confirms that UL+UC+Ud remains within 0.3% of U0.

6. Comparison table

The table compares this baseline with two variants, highlighting how component changes affect damping and energy.

ScenarioR (Ω)L (H)C (F)ζU after 0.05 s (J)
Baseline100.10.0010.50.007
Lower R20.10.0010.10.011
Higher C100.10.0020.350.009

Reducing resistance lowers the damping ratio, preserving more energy after 0.05Ā s. Doubling the capacitance lengthens the oscillation period and slightly reduces damping, as reflected in the energy remaining.

7. How to read the animation

The canvas plots capacitor voltage in blue and inductor current in orange against time. The vertical scale auto‑adjusts to encompass extremes. A red circle marks the instantaneous state. Beneath the plot, striped bars show the fraction of energy stored in the capacitor, stored in the inductor, and dissipated as heat. Because each bar uses both color and pattern, the information remains discernible to users with color‑vision deficiencies. The caption and hidden text summary mirror the numerical state—time, voltage, current, and energies—so screen‑reader users receive equivalent feedback. Keyboard users can focus the canvas and press the spacebar to toggle play and pause.

8. Limitations

The model assumes ideal lumped components. Real inductors have winding resistance and parasitic capacitance; capacitors exhibit equivalent series resistance and inductance. At high frequencies, the circuit ceases to behave as a simple loop because electromagnetic waves introduce propagation delays. The simulation also neglects nonlinear effects such as core saturation or dielectric breakdown. Numerically, RK4 still accumulates truncation error if the time step is large relative to the oscillation period, manifesting as slight energy drift. Extremely stiff circuits with very small L or C may require smaller steps than the interface allows. Finally, the natural response shown here excludes external forcing; real circuits are often driven by step or sinusoidal sources.

9. Possible extensions

Future enhancements could incorporate a driving voltage to illustrate resonance and steady‑state phase shifts, or allow switching between series and parallel configurations. Adding an optional diode would enable simulation of rectifier ringing. A phase‑space plot of current versus voltage would reveal spiraling trajectories toward equilibrium. Because the code runs entirely client‑side without external libraries, adventurous users can modify it to test their own ideas. For related explorations, try the RL Circuit Current Simulator, examine frequency response with the RLC Circuit Impedance Calculator, or compare mechanical analogs using the Mass–Spring–Damper Simulator.

10. References

For deeper treatment of transient circuits, see P. Horowitz and W. Hill, The Art of Electronics, 3rdĀ ed., Cambridge University Press, 2015; A. Sedra and K. Smith, Microelectronic Circuits, 8thĀ ed., Oxford University Press, 2020. Historical perspectives on damping appear in J. Clerk Maxwell’s On Physical Lines of Force. Interactive circuit applets inspired this visualization approach.

Embed this calculator

Copy and paste the HTML below to add the RLC Damping Simulator - Transient Energy Visualization to your website.