Electromagnetism: magnetic fields in 3D
Real field calculations, not drawings. Choose a dipole, bar magnet, solenoid or Halbach array and see its field three ways: field lines traced in 3D, a slice of iron filings lined up with the field, and particles flowing along the lines. A second view sends charged particles spiralling through a magnetic field.
This interactive simulation runs in your browser with WebGL. Free, no account needed.
What you can explore
Field lab
Field lines are traced through the true field with RK4 and coloured by strength, with dashes flowing from north to south. A vertical slice shows thousands of iron filings and contours of |B|. The Halbach array shows its one-sided field: strong above, nearly zero below.
Lorentz force
Charged particles move through a uniform magnetic field and curve into circles and helices. Change the field strength to see the cyclotron radius shrink as r = mv/qB.
Key equations
B = (μ₀/4π) [3(m·r̂)r̂ − m] / r³∇·B = 0F = qv × Br = mv / qB
Curriculum
AQA A-level physics 3.7.5, IB Physics D.3.
Common questions
Why do magnetic field lines form closed loops?
There are no magnetic monopoles, so the divergence of B is zero everywhere. Lines leaving a north pole always return to the south pole, continuing through the magnet.
What is a Halbach array?
An arrangement of magnets whose magnetisation rotates from one block to the next, which reinforces the field on one side and nearly cancels it on the other. It is used in maglev trains and motors.
More physics simulations
- Special Relativity: Light cone, Time dilation, Length contraction
- Quantum Mechanics: Bloch sphere, Particle in a box, Double slit, Entanglement, Tunnelling
- General Relativity: Curvature, Geodesics, Gravitational waves
- Wave Mechanics: Ripple tank, Double slit, Normal modes
- Optics: Prism, Lens lab, Diffraction grating
- Dynamical Systems: Lorenz attractor, Rössler attractor, Thomas attractor, Aizawa attractor, Phase space, Double pendulum
- Thermodynamics: Gas, Entropy, Heat engine, Ising model
- Fluid Dynamics: Streamlines, Vortex shedding, SPH dam break
- Acoustic Physics: Cymatics, Harmonics, Lissajous
- Frontier Physics: Black hole, Rotation curves, Hubble expansion, N-body
- Physics Sandbox: Sources, Presets