Built for interactive demonstration of the Greenshields Traffic Flow Model.
You may use the demonstration for teaching or research purposes, but please cite as:
Ollero, L. J. (2025). Traffic Flow Theory: Greenshields Model Interactive Visualization.
Available at:
https://lesterjayollero.github.io/TrafficFlowTheory.github.io
The Greenshields Model is the earliest and most fundamental relationship in traffic flow theory. It assumes a linear relationship between vehicle speed and traffic density. From this assumption, we can derive the three fundamental diagrams that describe the behavior of a traffic stream.
Greenshields assumed a linear relation between speed $u$ and density $k$:
$$u(k) = u_f\left(1 - \frac{k}{k_j}\right)$$
Flow (volume) is $q = k \cdot u$. Substituting the speed–density relation:
$$q(k) = u_f k \left(1 - \frac{k}{k_j}\right) = u_f k - \frac{u_f}{k_j}k^2$$
This is a concave quadratic in $k$ (a parabola opening downward). To find maximum flow:
$$\frac{dq}{dk} = u_f - 2\frac{u_f}{k_j}k = 0 \quad \Rightarrow \quad k^* = \frac{k_j}{2}$$
Thus, the critical density (density at maximum flow) is $k^* = \frac{k_j}{2}$. The speed at that point is:
$$u^* = u_f\left(1 - \frac{k^*}{k_j}\right) = \frac{u_f}{2}$$
The maximum flow is:
$$q_{\max} = \frac{u_f k_j}{4}$$
Solve density from the linear relation:
$$k = k_j\left(1 - \frac{u}{u_f}\right)$$
Substitute into $q = k \cdot u$:
$$q(u) = k_j u \left(1 - \frac{u}{u_f}\right) = k_j\left(u - \frac{u^2}{u_f}\right)$$
This is also a concave parabola in $u$, with maximum at $u^* = \frac{u_f}{2}$ and $q_{\max} = \frac{u_f k_j}{4}$.
1️⃣ $u(k) = u_f\left(1 - \frac{k}{k_j}\right)$
2️⃣ $q(k) = u_f k\left(1 - \frac{k}{k_j}\right)$
3️⃣ $q(u) = k_j u\left(1 - \frac{u}{u_f}\right)$
Critical points: $k^* = \frac{k_j}{2}, \; u^* = \frac{u_f}{2}, \; q_{\max} = \frac{u_f k_j}{4}$.