See what happens inside an electrical circuit
Pick a circuit below, change a few numbers, and watch the voltages and currents change over time. There's nothing to install and no account to make. The graphs update as you move the sliders.
1 Pick a circuit
2 Change the numbers
3 Watch what happens
Tip: drag across the graph to zoom in. Double-click to zoom back out.
Advanced: view or edit the circuit as text
This is the circuit the simulator is actually running. Edit it and press Run to simulate your own circuit. Choosing a circuit above brings the guided mode back.
Circuit language reference
One part per line: NAME node1 node2 value. Node 0 (or gnd) is ground. Lines starting with * are comments.
Values accept suffixes: f p n u m k meg g t (10m = 0.01, 4.7u = 0.0000047, 2meg = 2,000,000)
R1 a b 10 Resistor, ohms
L1 a b 5m Inductor, henries
C1 a b 100u Capacitor, farads
K1 L1 L2 0.98 Couples two inductors (a transformer). Coupling 0 to 0.9999
V1 a b DC 12 Voltage source. Also: SIN amp freq [phase_deg] [offset]
STEP value start_time PULSE v1 v2 delay rise fall width period
I1 a b DC 2 Current source (current flows a to b through the source)
V1 g 0 SYNC e=11k s=25meg [f=60 h=2 p0=10meg delta=5 d=2 droop=0.05 tg=0.5 pmax=1 hold=50m
pmin=-1 wh=50meg soc0=0.6 ramp=1]
Generator with inertia: voltage e (peak) at an angle that moves with a swing equation
(h = inertia in seconds, s = rating in watts, p0 = scheduled power, droop 0 = isochronous).
Models three identical phases, so power is 3 x the one-phase value.
With pmin=-1 and wh= (energy in watt-hours) it acts as a grid-forming battery that can charge and
discharge. S(V1) plots its state of charge in percent; it cannot discharge when empty or charge when full.
I2 0 bus FOLLOW V1 100 [t0=4 ramp=1.5 n=8 stag=0.5]
Current source of peak 100 A that copies the angle of generator V1 (an ideal PLL).
Optional: n identical units start one after another from time t0, every stag seconds, each
ramping up over ramp seconds (a wind farm starting). The peak current is per unit.
SW1 a b 10m [20m] Switch: closes at 10 ms, optional opening time. Or: SW1 a b PWM 20k 0.5
D1 anode cathode Ideal diode
.tran 10u 20m Time step and stop time (required)
.probe V(a) V(a,b) I(L1) What to plot: node voltage, voltage between two nodes, part current
F(V1) = generator frequency in Hz, D(V1) = generator angle in degrees, S(V1) = battery charge in %
Currents are positive from the first node to the second node of the part.
Opening a switch while current flows through an inductor makes a huge voltage spike, just like in real life.
Switching converters: when an inductor's current first drops to zero (for example during start-up), the voltage at a
floating switch/diode node can show brief numerical ringing. It does not affect the other results.
This tool is free and always will be. It runs entirely in your browser, so nothing you type is ever uploaded. If it saved you time or helped you learn, a small donation helps cover hosting and keeps it online.
♥ Buy me a coffee