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.
The simulator models an ideal series loop consisting of resistance , inductance , and capacitance . The capacitor starts with voltage and the inductor with current . 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 is clamped between 0.0001 and 0.1Ā s. The total run time must exceed ten steps to ensure the plot has meaning.
Magnetic energy in the inductor is , while electric energy in the capacitor is . Power dissipated in the resistor is , which integrates to the gray āLossā bar.
Applying Kirchhoffās loop rule yields
where is the capacitor charge. Expressed in terms of capacitor voltage , the firstāorder system becomes
,ā
The undamped natural frequency and damping ratio follow
,ā
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 for quick reference.
The code integrates the coupled equations using a fourthāorder RungeāKutta (RK4) method, chosen for accuracy and stability. For state vector and derivative function , RK4 advances the solution by
with , , 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 ; the form warns if this guideline is violated.
Each step also accumulates dissipated energy . The initial total energy scales the energy bars so that the blue (capacitor) and orange (inductor) regions shrink as the gray loss bar grows.
Consider Ā Ī©, Ā H, and Ā F. The natural frequency is Ā rad/s, and the damping ratio , an underdamped case. Charging the capacitor to 5Ā V with zero current stores Ā J of energy. Running the simulator with Ā s for Ā 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 remains within 0.3% of .
The table compares this baseline with two variants, highlighting how component changes affect damping and energy.
Scenario | R (Ω) | L (H) | C (F) | ζ | U after 0.05 s (J) |
---|---|---|---|---|---|
Baseline | 10 | 0.1 | 0.001 | 0.5 | 0.007 |
Lower R | 2 | 0.1 | 0.001 | 0.1 | 0.011 |
Higher C | 10 | 0.1 | 0.002 | 0.35 | 0.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.
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.
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 or 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.
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.
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.