HomeArticlesDeep Ocean & Underwater World

How Whales Navigate: Agent-Based Models of Migration

No GPS, no charts — whales cross entire ocean basins on the same seasonal routes every year, and simulating that means simulating each whale, not the whole ocean.

mysimulator teamUpdated July 2026≈ 7 min read▶ Open the simulation

A migration nobody plans yet everybody follows

Grey whales travel roughly 16,000-20,000 km round trip between Arctic feeding grounds and Baja California breeding lagoons every year — one of the longest migrations of any mammal — and humpback, blue and right whales follow their own equally long, equally consistent seasonal circuits between cold, food-rich high latitudes and warm, calf-friendly low-latitude breeding waters. No individual whale is born knowing a map; each generation follows routes that appear to be learned and reinforced within pods, tracking a genuine trade-off between food abundance (concentrated near the poles) and calf survival (better in warm water with fewer orca predators).

The cues: magnetic, celestial, and learned

No single mechanism fully explains how whales hold a bearing across thousands of kilometres of open, featureless ocean, but several candidate cues are well supported. Many marine animals carry magnetite crystals or light-sensitive proteins that plausibly let them sense the Earth's magnetic field, which varies predictably enough with latitude and longitude to act as a rough compass and even a positional grid. Whales also appear to use the position of the sun and stars, memorised coastline and seafloor topography passed down within family groups, and possibly low-frequency sound that travels enormous distances underwater and could carry information about distant coastlines. Different species and even different individuals likely weight these cues differently, which is part of why migration routes, while broadly consistent, are not perfectly identical every year.

live demo · a pod following a seasonal route● LIVE

Why "agent-based" is the right kind of model here

You could try to describe migration with one big equation for the whole population's average position over time, but that throws away exactly the thing that makes migration interesting: it's individuals, coordinating locally, that produce the group-level pattern. An agent-based model instead gives each whale its own simple rule set — steer toward a remembered goal bearing, stay loosely near podmates, avoid obstacles and excessive noise, adjust speed to conserve energy — and lets the pod-level route emerge from thousands of individual decisions repeated every simulated time step. This is the same family of technique used for flocking birds and schooling fish (Reynolds' boids model), adapted here with a long-range goal-seeking term layered on top of the usual cohesion and separation rules.

for each whale agent, each simulated step:
  v_goal      = bearing toward the seasonal destination      (long-range pull)
  v_cohesion  = steer toward the local pod centre             (stay together)
  v_separation= steer away from whales that are too close     (avoid collision)
  v_avoid     = steer away from noise sources / obstacles     (shipping lanes)

  velocity = weighted_sum(v_goal, v_cohesion, v_separation, v_avoid)
  position += velocity * dt

Shipping noise as a disruptive input

Because whale communication and navigation lean so heavily on sound — some low-frequency calls travel hundreds of kilometres through the deep sound channel — one of the most tractable things to add to a migration model is anthropogenic noise, principally from commercial shipping engines and propellers. In a simulation this is modelled as a spatial noise field that raises the "avoid" weight near busy shipping lanes and degrades the range at which pod members can coordinate, which can visibly fragment cohesive pods, delay migration timing, and force detours around otherwise efficient routes — a reasonably faithful stand-in for what field researchers have documented with real whale populations near major ports and lanes.

Frequently asked questions

How do whales know which way to migrate?

Researchers think whales combine several cues rather than relying on one: sensitivity to the Earth's magnetic field (likely via magnetite-based receptors or a light-dependent magnetic sense), memorised coastline and seafloor topography passed down within pods, the position of the sun and stars, and possibly infrasonic ocean noise from distant coastlines. No single mechanism has been proven to work alone, and different species likely weight these cues differently.

Why do agent-based models suit whale migration better than a single equation?

Migration is not one animal following an optimal path — it's many individuals each responding to local cues (bearing toward a goal, staying near podmates, avoiding obstacles and noise) whose interactions produce the group-level route. Agent-based models simulate each whale as a rule-following agent and let the realistic pod-level pattern emerge from those individual rules, which a single top-down equation for the whole population cannot easily capture.

How does shipping noise actually interfere with whale navigation?

Commercial vessel engines and propellers generate continuous low-frequency noise in roughly the same range whales use for long-distance communication and, in some species, echolocation. That noise raises the background level whales must call over, forcing them to call louder, shorten calls, or abandon communication over a stretch of ocean — which can separate mothers from calves, disrupt coordinated feeding, and in severe cases has been linked to stranding events near very loud sound sources such as naval sonar.

Try it live

Everything above runs in your browser — open Whale Migration and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Whale Migration simulation

What did you find?

Add reproduction steps (optional)