Coil field (glow = current)
Ferromagnetic ball
Setpoint gap
drag the ball · click Nudge to disturb it
The 3D version of this simulation is a decorative shared-template scene (a generic percentage-slider dashboard reused across a family of unrelated "labs", with no real levitation formula behind it). This 2D companion instead builds the actual physics: a ferromagnetic ball on a vertical track, an electromagnet whose pull follows F = k·I²/x², and a PID feedback loop that reads the gap and drives the coil current to hold the ball at a setpoint — the same open-loop-unstable, closed-loop-stabilized system used to teach magnetic levitation control in real labs.