About MagnetSim

A small set of rules. An open-ended experiment.

MagnetSim is a browser-based exploration of interacting magnetic needles. Each needle occupies a fixed position and responds to its immediate neighbors. Together, these local interactions can produce aligned regions, persistent motion, and changing patterns.

From a Galaxy Far Far Away

This simulation's original life started in 1990, running on an Acorn Archimedes A3000 (8MHz ARM2, 1MB RAM, 100MB ext. HDD, running RISCOS 2), written in BBC BASIC V. It was running a field of just 5x5 needles on a 640x256 full-screen mode display in black+white, achieving 5-10 frames/sec. Only the "rotating needle" property existed as an option.

From Python to the browser

The 2026 rewrite of the simulation used Python, NumPy, and Pygame. This browser-based version preserves its discrete needle model while using browser graphics and JavaScript or WebAssembly for the simulation. No account or simulation server is needed. The Manual explains the model and its parameters.

What the project is for

The project invites you to experiment: change an angle, add a disturbance, drive an edge, or pause to inspect the result. It can support curiosity about collective behavior and discrete simulations, but it is not a substitute for a validated material model or a laboratory experiment.

Limits worth understanding

Only immediate neighbors interact. There is no full electromagnetic field calculation, physical calibration, or energy-conserving integrator. Results depend on the configuration, initialization, and numerical implementation. Similar-looking patterns are not proof that the model reproduces a particular real material.

Your device and your settings

The simulation runs on your device. Configuration and presets are saved in this browser's site data; you can also export and import configuration files. Clearing that site data removes local saves. Leaving the simulator and returning creates a new running field from the saved settings. This site adds no analytics or advertising scripts.

Read the Manual or open the field and begin exploring.

Start this!