Social Force Model
Dirk Helbing's Social Force Model treats pedestrians as particles subject to Newtonian-like forces: a driving force toward their destination, repulsive forces from other pedestrians and walls, and optional attractive forces. The model famously reproduces emergent phenomena like lane formation, oscillation at bottlenecks, and faster-is-slower effects in evacuations.
1. Equation of Motion
Each pedestrian \(i\) of mass \(m_i\) has position \(\mathbf{r}_i\) and velocity \(\mathbf{v}_i\). The equation of motion is:
$$m_i \frac{d\mathbf{v}_i}{dt} = \mathbf{F}_i^{\text{desired}} + \sum_{j \neq i} \mathbf{F}_{ij}^{\text{rep}} + \sum_w \mathbf{F}_{iw}^{\text{wall}} + \boldsymbol{\xi}_i$$
where \(\boldsymbol{\xi}_i\) is a stochastic fluctuation term representing individual variations in behaviour. Each force component has a distinct physical interpretation.
2. Desired (Driving) Force
The desired force models the pedestrian's intention to walk toward their destination at a preferred speed \(v_i^0\) in direction \(\mathbf{e}_i\):
$$\mathbf{F}_i^{\text{desired}} = m_i \frac{v_i^0 \, \mathbf{e}_i - \mathbf{v}_i}{\tau_i}$$
Here \(\tau_i\) is the relaxation time, typically 0.5 seconds, representing how quickly the pedestrian adjusts to their desired velocity. The direction \(\mathbf{e}_i\) points from the current position to the next waypoint:
$$\mathbf{e}_i = \frac{\mathbf{r}_i^{\text{goal}} - \mathbf{r}_i}{|\mathbf{r}_i^{\text{goal}} - \mathbf{r}_i|}$$
This force continuously accelerates the pedestrian toward \(v_i^0 \mathbf{e}_i\). Without other forces, the velocity exponentially relaxes:\(\; \mathbf{v}_i(t) = v_i^0 \mathbf{e}_i + (\mathbf{v}_i(0) - v_i^0 \mathbf{e}_i) e^{-t/\tau_i}\).
3. Pedestrian Repulsion
Pedestrians maintain a personal space. The repulsive force between pedestrians \(i\) and \(j\) decays exponentially with distance:
$$\mathbf{F}_{ij}^{\text{rep}} = A \exp\!\left(\frac{r_{ij} - d_{ij}}{B}\right) \hat{\mathbf{n}}_{ij}$$
where:
- \(r_{ij} = r_i + r_j\) is the sum of body radii
- \(d_{ij} = |\mathbf{r}_i - \mathbf{r}_j|\) is the centre-to-centre distance
- \(\hat{\mathbf{n}}_{ij} = (\mathbf{r}_i - \mathbf{r}_j) / d_{ij}\) is the unit normal from \(j\) to \(i\)
- \(A \approx 2000 \text{ N}\) is the interaction strength
- \(B \approx 0.08 \text{ m}\) is the range of the repulsion
An anisotropic version accounts for the fact that pedestrians react more strongly to people in their field of view:
$$\mathbf{F}_{ij}^{\text{rep}} = A \exp\!\left(\frac{r_{ij} - d_{ij}}{B}\right) \hat{\mathbf{n}}_{ij} \cdot w(\varphi_{ij})$$
with the anisotropy weight \(w(\varphi) = \lambda + (1-\lambda)\frac{1+\cos\varphi}{2}\), where \(\varphi_{ij}\) is the angle between \(\mathbf{e}_i\) and \(-\hat{\mathbf{n}}_{ij}\), and \(\lambda \approx 0.5\).
4. Wall Repulsion
Walls exert a similar repulsive force:
$$\mathbf{F}_{iw}^{\text{wall}} = A_w \exp\!\left(\frac{r_i - d_{iw}}{B_w}\right) \hat{\mathbf{n}}_{iw}$$
where \(d_{iw}\) is the shortest distance from pedestrian \(i\) to wall \(w\), and \(\hat{\mathbf{n}}_{iw}\) is the normal pointing away from the wall. In dense crowds where pedestrians are pushed against walls, additional body compression and sliding friction forces are included:
$$\mathbf{F}_{iw}^{\text{contact}} = k \, g(r_i - d_{iw}) \, \hat{\mathbf{n}}_{iw} + \kappa \, g(r_i - d_{iw}) \, (\mathbf{v}_i \cdot \hat{\mathbf{t}}_{iw}) \, \hat{\mathbf{t}}_{iw}$$
where \(g(x) = \max(0, x)\) activates only during physical contact,\(k \approx 1.2 \times 10^5\) N/m is the body stiffness, and \(\kappa \approx 2.4 \times 10^5\) kg/(mยทs) is the friction coefficient.
5. Emergent Lane Formation
One of the most striking emergent phenomena in the Social Force Model is lane formation. When two groups of pedestrians walk in opposite directions in a corridor, they spontaneously organise into lanes -- without any explicit coordination.
The mechanism is intuitive: a pedestrian walking to the right is repelled less by other rightward-walking pedestrians (who are moving alongside) than by leftward-walking ones (who approach head-on with higher closing speed). Over time, same-direction pedestrians cluster. The lane order parameter is:
$$\Phi = \left\langle \frac{1}{N_i} \sum_{j \in \mathcal{N}_i} \text{sign}(v_j^x) \cdot \text{sign}(v_i^x) \right\rangle_i$$
where the average is over all pedestrians and their neighbours \(\mathcal{N}_i\). When \(\Phi \to 1\), perfect lanes have formed; when \(\Phi \approx 0\), pedestrians are mixed.
6. Python: Corridor Flow with Lane Formation
We simulate two groups of pedestrians walking in opposite directions in a corridor. The simulation uses the Social Force Model with periodic boundary conditions along the corridor axis.
Social Force Model: Corridor Lane Formation
PythonClick Run to execute the Python code
Code will be executed with Python 3 on the server
7. Evacuation Dynamics and the Faster-is-Slower Effect
In emergency evacuations, Helbing et al. discovered a counter-intuitive phenomenon: increasing the desired speed (panic parameter) above a critical value decreases the flow through a bottleneck. This is the faster-is-slower effect.
The mechanism: at high desired speeds, pedestrians push harder toward the exit, forming clogging arches. The flow rate \(J\) as a function of desired speed \(v^0\) is:
$$J(v^0) \propto \begin{cases} v^0 & v^0 < v^0_c \\ v^0 \exp\!\left[-\gamma (v^0 - v^0_c)^2\right] & v^0 \geq v^0_c \end{cases}$$
The panic parameter can be incorporated by modifying the relaxation time:
$$\tau_{\text{panic}} = \tau_0 (1 - n_{\text{panic}}) + \tau_{\min} \cdot n_{\text{panic}}$$
where \(n_{\text{panic}} \in [0, 1]\) interpolates between normal (\(\tau_0 \approx 0.5\) s) and panicked (\(\tau_{\min} \approx 0.1\) s) behaviour. Higher panic also increases the desired speed: \(v^0_{\text{panic}} = (1 + n_{\text{panic}}) v^0_{\text{normal}}\).
Evacuation: Faster-is-Slower Effect
PythonClick Run to execute the Python code
Code will be executed with Python 3 on the server