About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 5 July 2026

This simulation visualises the Helbing–Molnár social force model of pedestrian dynamics, in which every person is treated as a self-driven particle. Each agent accelerates toward its personal goal with a relaxation force (v⁰ê − v)/τ, while an exponential repulsion force A·exp((r−d)/B) keeps it from colliding with neighbours and walls. From these simple per-agent rules, large-scale crowd patterns such as lane formation, arch-shaped jams at doorways, and the counter-intuitive faster-is-slower effect emerge on their own.

🔬 What it shows

Four scenarios — a counter-flow corridor, a bottleneck door, a four-way intersection, and a room evacuation — driven by the same social-force equations. Agents seek their goal, repel each other and walls, and their combined motion self-organises into lanes in the corridor, alternating arch-shaped clogs at the bottleneck door, rotating traffic at the intersection, and a bounded evacuation flow through the exit.

🎮 How to use

Pick a Scenario, then tune Agents (50–400), Desired speed v⁰ (0.5–5.0 m/s), Repulsion A and Range B (how strongly and over what distance agents avoid each other), and Wall strength. Toggle the Density heatmap or Velocity arrows to see crowding and flow direction, and watch the Stats panel for mean speed, density, jam fraction, and — in Bottleneck or Evacuation — exits per minute and total evacuation time.

💡 Did you know?

Pushing the desired walking speed v⁰ above roughly 2 m/s in the Bottleneck scenario does not speed up the exit — the exits/min readout actually drops. This is the real, empirically documented faster-is-slower effect: agents that rush toward a narrow door pack in tighter, arch-jam more often, and the whole crowd clears more slowly than a calmer one.

Frequently asked questions

What is the social force model?

The social force model, introduced by Dirk Helbing and Péter Molnár, describes each pedestrian as being pushed and pulled by forces much like a physical particle. A driving force pulls the agent toward its desired velocity, while repulsive forces from other pedestrians and from walls prevent collisions. Summing these forces and integrating them over time produces surprisingly realistic crowd behaviour from very simple rules.

How does the simulation calculate each agent's motion?

Every step, each agent gets a driving force (v⁰ê − v)/τ that accelerates it toward its goal direction ê at its desired speed v⁰, with τ as a relaxation time. Nearby agents and wall segments add an exponential repulsion force A·exp((r−d)/B), where d is distance and r is the combined body radius, so the push grows sharply as bodies get close. All forces are summed into an acceleration, velocity is capped and integrated, and the agent's position is updated each timestep.

Why does a crowd form lanes in the counter-flow corridor?

When two streams of agents walk in opposite directions, head-on collisions are costly under the repulsion force, so agents that happen to drift slightly to one side avoid more conflicts and survive longer without being pushed backward. This selective advantage compounds over time until the crowd self-organises into alternating lanes of same-direction walkers, letting opposing streams pass each other with far fewer close encounters — entirely without any agent being told to form a lane.

What causes the arch-shaped jams at the bottleneck door?

As agents converge on a narrow doorway faster than the door can let them through, the repulsion force between tightly packed neighbours builds into a stable arch shape spanning the opening, similar to how grains jam in an hourglass neck. The arch periodically breaks and reforms as pressure from behind builds up and releases, which is why the exits/min stat fluctuates rather than staying constant even at fixed agent count.

Is "faster is slower" really real, or just an artefact of this simulation?

It is a genuine, well-documented phenomenon in real crowd dynamics and evacuation research, not just a quirk of this model — it is one of the reasons evacuation drills teach people to walk calmly rather than sprint. In the model it arises because higher desired speed v⁰ increases how forcefully agents push into the bottleneck, making arch jams more frequent and severe, which lowers the net throughput even though every individual is trying to move faster.