Magnetic Pendulum (2D) — force field and basin-of-attraction map

Switch to 3D
Each pixel of the map is a pendulum released at rest from that point; its colour is the magnet it ends on.
Settings
What to try
  • Lower the damping to 0.1: the bob crosses between wells many times and the coloured regions interleave into thin fractal filaments.
  • Raise the damping above 1: the basins become smooth wedges (one swing decides everything).
  • Click two points a few pixels apart near a filament: tiny differences in the release point give different final magnets.
The science

The bob moves in a plane (small-angle pendulum) under: restoring force F = −k r, three magnet attractions Fi = s / di2.2 towards magnet i (distance clamped below 0.28), and linear drag −c v. Equation: r″ = −k r + Σi s di−2.2 d̂i − c r′. Magnets sit on a circle of radius 1.9 at 120°.

Energy E = ½v² + ½k r² − Σ s d−1.2/1.2 falls at the rate dE/dt = −c v²; the page integrates this dissipation and checks E(t) + W = E(0). The basin map integrates a trajectory from every cell (RK4, h = 0.04 s) until it rests.

Simplifications: the exponent 2.2 is a stylised magnet law (a real dipole falls off faster), no pendulum-length nonlinearity, the cut-off below 0.28 is a numerical softening, the pivot height is not modelled. This is a chaos demonstration, not a magnet model.