🧲 Active Magnetic Levitation (2D)
2D electromagnet levitation simulator: real force law F = k·I²/d², a proportional feedback controller that adjusts coil current to hold a floating object at a setpoint height, and a feedback off/on toggle that shows Earnshaw's theorem instability without active control.
⚙ Under the hood
A 2D side-view electromagnet levitation simulator: a coil above pulls a floating object upward with F = k I^2/d^2 while gravity pulls it down. A proportional feedback controller adjusts the coil current in real time to hold the object at a setpoint height. Switch feedback off to see Earnshaw's theorem in action as the equilibrium becomes unstable.
electromagnetismfeedback controlPIDlevitationEarnshaw's theorem
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install