HomePhysics & MechanicsMaglev Train

🚄 Maglev Train

Interactive magnetic levitation (maglev) simulator. Compare EDS (electrodynamic, repulsive) and EMS (electromagnetic, attractive) suspension. See levitation force versus gap and speed, the lift-off speed, lift/drag ratio, linear-motor propulsion, and EMS active-gap control. Adjust speed, magnet strength, payload and control gain and watch the train rise off its wheels.

Physics & Mechanics3DAdvanced60 FPS⚡ Plasma
maglev-train ↗ Open standalone

About this simulation

This simulator computes magnetic levitation from first principles for two suspension types. For EDS (electrodynamic), lift is modelled as F0·v²/(v²+v₀²)·e−(gap−8)/22 — zero at rest, saturating at speed, and decaying with gap — while the actual ride gap is found each frame via a 30-step bisection search for where this lift balances the train's weight; drag follows F_drag = F_lift·(v₀/v). For EMS (electromagnetic), lift scales as 1/gap², an inherently unstable relationship, so the gap is instead integrated as a real second-order spring-mass system driven by the lift/weight imbalance plus a proportional–derivative feedback term (gain·error − gain²·velocity); too little gain lets the train sag, too much makes the gap oscillate. A separate phase variable animates the travelling magnetic wave of the linear-motor propulsion, independent of the levitation physics.

What it shows

Two live plots — lift & drag versus speed, and lift versus gap — plus a 3D cross-section of the train riding its computed gap above the guideway, with field-line sway that reacts to suspension mode and gap size.

How to use it

Switch between EDS and EMS, drag the speed/magnet-strength/payload/gain sliders, or jump straight to the four presets (EDS high-speed, EMS hover, Overloaded, Unstable gain) to see each regime's failure and success modes.

Did you know?

Because EDS lift needs relative speed to exist, every EDS maglev — including Japan's SCMaglev — must ride on ordinary wheels below its lift-off speed and only floats once it is already moving.

Frequently Asked Questions

How does this simulator decide the levitation gap each frame?

In EDS mode it solves quasi-statically: a 30-step bisection search finds the gap between 4 mm and 60 mm at which the speed- and gap-dependent lift force edsLift(v, gap) exactly balances the train's weight, then the displayed gap eases toward that target. In EMS mode there is no lookup — a real spring-mass differential equation is integrated every frame, with gap acceleration driven by the lift/weight imbalance plus a PD-style controller term proportional to gain×gap-error minus gain²×gap-velocity.

Why does EDS lift depend on both speed and gap in this model?

The code models EDS lift as F0·v²/(v²+v0²)·exp(−(gap−8)/22), where v0 = 100 km/h is a characteristic scale. The first factor is zero at rest and saturates toward 1 as speed rises, reflecting how induced eddy currents (and their repulsive force) only appear once the magnets sweep past the guideway fast enough. The exponential factor makes lift fall off smoothly as the gap widens, since induced-current coupling weakens with distance.

How is magnetic drag calculated for EDS?

The simulator uses F_drag = F_lift·(v0/v), so drag is largest at low speed (near lift-off) relative to lift, and shrinks as a fraction of lift once the train is going fast. This reproduces the real-world EDS behaviour where the lift/drag ratio keeps improving with speed, which is why EDS trains are more efficient at high cruising speed than near lift-off.

Why can the EMS mode become unstable?

EMS attraction grows as 1/gap² in the code (emsLift scales with (10/gap)²), so it is an inherently unstable equilibrium — the closer the gap, the stronger the pull, which pulls it closer still. The simulator counteracts this with a PD-style feedback term (gain×error − gain²×velocity damping) inside the gap's equation of motion. At low gain the gap sags because the restoring term is too weak; at high gain the destabilising gain² term dominates and the gap oscillates or clamps against its 1 mm/40 mm limits — exactly what the "Unstable gain" preset demonstrates.

What does the levitation power readout represent?

For EDS the code reports power as drag force × speed, i.e. the kinetic energy continuously lost to induced-current (eddy-current) drag while cruising — EDS itself needs no separate holding power since the repulsion is a free by-product of motion. For EMS the code instead reports current²×30 + 18 kW, modelling resistive (I²R) heating in the electromagnet coils that must run continuously — even at a standstill — to hold the train up against gravity.

⚙ Under the hood

Magnetic levitation: EDS (repulsive, speed-dependent) vs EMS (attractive, actively controlled gap). See lift-off speed, the levitation gap, and lift/drag as the train accelerates from wheels onto a magnetic cushion.

PhysicsMaglevMagnetic LevitationEDSEMS

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)