The macroscopic traffic-flow model by Lighthill-Whitham-Richards (LWR) is an hydrodynamic model for traffic flow on a single infinite road. It consists in a scalar hyperbolic conservation law, which represents the conservation of cars (continuity equation):
$$
\frac{\partial}{\partial t}\rho + \frac{\partial}{\partial x}Q (\rho) = 0 \, ,
$$
where the flux $Q(\rho) = \rho\, v(\rho)$ depends only on the density of cars $\rho$. The simplest expression for the car velocity $v(\rho)$, introduced by Greenshields, reads
$$
v(\rho) = v_\max \left(1 - \frac{\rho}{\rho_\max}\right) .
$$
Therefore, the present case corresponds to $v_\max = 1$ m/s and $\rho_\max=1$ car/m. The flux function $Q (\rho) = \rho \left(1- \rho\right)$ is maximum at $\rho = 1/2$ car/m, which is assumed to be the uniform density of cars at negative times. The characteristic curves such that $\rho(x,t)=\rho(x(t),t)$ satisfy
$$
\frac{d\rho}{dt} = \frac{\partial\rho}{\partial t} + \underbrace{\frac{dx}{dt}}_{Q'(\rho)} \frac{\partial\rho}{\partial x} = \alpha \boldsymbol{1}_{0\leq x(t) < 1,\, t\geq 0} \, ,
$$
where $\alpha$ is the rate per unit length of cars entering the highway via an on-ramp. Several cases are considered:
- For times $t<0$, $\rho=1/2$ and $dx/dt = 1 - 2\rho = 0$. The space-time diagram is made of vertical lines, on which the car density is constant.
- When the ramp is turned on, i.e. $t\geq 0$, one has $d\rho/dt = \alpha$, i.e. $\rho = \alpha t + 1/2$ over the ramp. The characteristics satisfy $dx/dt = 1 - 2 \rho = -2\alpha t$. Therefore, over the on-ramp, the space-time diagram is made of non-crossing decreasing functions, on which the car density is not constant. Qualitatively, these curves will interact with the vertical lines in the following way:
- a left-going shock wave is created on the left of the ramp: the upstream cars stop suddenly;
- a left-going rarefaction wave (fan) is created on the right of the ramp: the inserted cars accelerate gradually, until they reach the maximum-flux velocity.
A more quantitative solution is possible. At this point, one can decide to solve the conservation law with source term
$$
\frac{\partial}{\partial t}\rho + \frac{\partial}{\partial x}Q (\rho) = \alpha \boldsymbol{1}_{0\leq x < 1,\, t\geq 0}
$$
numerically, or to have a look at this post.