RC and RL Circuit Simulator
Equations in this simulation
| R | Resistance R (ohms, as a power of 10) | limits the current | |
|---|---|---|---|
| C | Capacitance C (µF) | how much charge the capacitor holds per volt | |
| L | Inductance L (mH) | how strongly the coil opposes a change in current | |
| τ | time constant | after one τ the change is 63% done, after five τ more than 99% |
With the current values:
| V | Battery voltage V (volts) | ||
|---|---|---|---|
| V_C | voltage across the capacitor | rises toward V; while discharging it falls as V₀ e^(−t/τ) | |
| I | current in the wire | largest the moment the switch closes, then dies away | |
| t | time since the switch was flipped |
With the current values:
| V_L | voltage across the inductor | the coil fights the change: all of V at first, none once the current is steady |
|---|
With the current values:
| E | energy stored | in the electric field between the plates, or in the magnetic field of the coil |
|---|
With the current values:
How to use the RC and RL circuit simulator
- Choose a resistor with a capacitor or with an inductor, and set the battery voltage, R, C and L. The switch closes at once: the blue dots are electrons drifting round the wire, faster when more current flows; on the capacitor the charges build up on the plates and the field between them grows, in the coil the magnetic field lines brighten.
- Press Flip the switch to take the battery out of the loop: the capacitor discharges through the resistor, or the coil keeps the current flowing for a while as its field collapses. Each flip starts a new exponential from the state the circuit is in.
- Read the time constant, current and voltages, and compare the curves with the formulas worked through below. Real time constants run from microseconds to minutes, so the clock is scaled to a set number of τ every 10 seconds. The RC Time Constant Calculator works out τ and the voltage at any time, and the Ohm's Law Calculator relates V, I and R.
Frequently asked questions
What is the time constant of an RC circuit?
τ = R × C, in seconds when R is in ohms and C in farads. It is the time a charging capacitor takes to reach 63% of the battery voltage, or a discharging one to fall to 37%. After 5τ it is more than 99% of the way, which is usually taken as fully charged. 1 kΩ with 470 µF gives 0.47 s.
Why does a capacitor charge exponentially?
The current that charges it is driven by the difference between the battery voltage and the capacitor's own voltage. As the capacitor fills, that difference shrinks, so the current falls in proportion to what is left to do. A rate proportional to the amount remaining is exactly what gives an exponential: V_C = V (1 − e^(−t/τ)).
What does an inductor do in a circuit?
It opposes any change in current, by making a voltage V_L = L dI/dt across itself. When the switch closes, it takes the whole battery voltage at first and lets the current build up only gradually, with τ = L ÷ R; when the supply is removed, it keeps the current flowing for a while. That is why switching off a relay coil can make a spark, and why such coils get a diode across them.
Do electrons really move that fast?
No, the dots are drawn much faster than real electrons. In a copper wire carrying a few milliamps, the electrons drift at a fraction of a millimeter per second. The current starts everywhere in the loop almost at once because the electric field travels at close to the speed of light, pushing all the electrons together, like water in a full pipe.
It says WebGL is turned off.
The 3D view needs WebGL, which every current browser has. It can be switched off by hardware acceleration being disabled in the browser settings, or by a very old graphics driver. Turn hardware acceleration on, or try another browser.
Is anything uploaded?
No. The simulation is drawn by your own browser with WebGL; nothing is sent anywhere, and it keeps working offline once the page has loaded.