traffic flow problem I am struggling with the following question:
Consider the conservation law
$$u_t + f(u)_x = 0, \: \text{where} \:  f(u) = u(1 − u). \:\:\:\:\quad (1)$$
This conservation law describes a model of traffic flow.
(a) Consider the case of a uniform traffic flow stopped by a red light at time $t = 0$ and $x = 0$. Find the solution of $(1)$ for $x < 0$ and $t > 0$ with the initial and boundary
data given by
$$u(x, 0) = 1/4, \: \text{for} \: x < 0, \quad \: u(0, t) = 1,\: \text{for}\: t > 0.$$
(b) Suppose now that at time $t_0 = 1$ the red light turns green. Hence the solution $u(x, t)$ for $x \in \mathbb{R}$ and $t > 1$ satisfies $(1)$ with the initial data
\begin{align*}
  &u(x,1)=\left\{
    \begin{array}{ll}
      1/4 , \quad if \: x<a_0 \\ 
      1 , \quad if \: a_0<x<0 \\ 
      0, \quad if \: x>0,\\
    \end{array}
  \right.
\\
 \end{align*}
where $a_0$ is the position of the discontinuity in part (a) at time $t_0 = 1.$
(i) At first the discontinuity travels at a constant speed as in part (a). Compute the time $t_1 > t_0$ at which the speed stops being constant.
(ii) Find the curve $y(t)$ describing the propagation of the discontinuity for $t > t_1$.
My attempt is as follows:
We have that $\frac{du}{dt}=0$ on characteristics $\frac{dx}{dt}=1-2u$.
Characteristics that originates in  $x<0$ at $t=0$ have $\frac{dx}{dt}=\frac{1}{2}$.
Hence, 
$u(x,t)=\frac{1}{4}$ with boundery char. $x=1/2t$
Thus, 
$u(x,t)=\frac{1}{4} : x<\frac{t}{2}$
$u(x,0)=\frac{1}{4} : 1<\frac{t}{2}$
$0<t$
I am unsure how to apply the boundary data and also for (b) as it is $u(x,1)$ i do not know how to proceed. Any help would be appreciated. 
 A: The car density $u$ is constant along the characteristics given by $dx/dt = f'(u)= 1-2u$. Thus, they are straight lines in the $x$-$t$ plane, given by $x(t) = \left[1-2\, u(0)\right] t + x(0)$.
(a) The characteristics with initial condition $x(0) < 0$ are increasing linear functions given by $x(t) = t/2 + x(0)$, on which $u = 1/4$. They cross the boundary condition corresponding to the red light, which may be represented by a vertical line in the $x$-$t$ plane on which $u=1$. A shock wave arises, which speed $a_0$ is given by the Rankine-Hugoniot jump condition
$$
a_0 = \frac{f(1) - f(1/4)}{1 - 1/4} = -1/4\, .
$$
(b.i) According to the previous answer, we have in facts
$$
u(x,t) = \left\lbrace
\begin{aligned}
&1/4 &&\mathrm{if}\quad x < a_0 t \, , \\
&1 &&\mathrm{if}\quad a_0 t < x \leq 0 \, , \\
&0 &&\mathrm{if}\quad 0 < x \, ,\\
\end{aligned}
\right.
$$
for $t\leq t_0$, where $t_0 = 1$. Now, $t>t_0$, i.e. the stop light is green. Several cases are considered:


*

*The characteristics with initial condition $x(1)<a_0$ are linear functions given by $x(t) = (t-1)/2 + x(1)$, on which $u = 1/4$.

*The characteristics with initial condition $a_0<x(1)\leq 0$ are linear functions given by $x(t) = 1-t + x(1)$, on which $u = 1$.

*The characteristics with initial condition $0<x(1)$ are linear functions given by $x(t) = t-1 + x(1)$, on which $u = 0$.


At the beginning, the shock wave with speed $a_0$ still exists, since the characteristics issued from $x(1)<a_0$ and $a_0 \leq x(1) < 0$ are still crossing. However, a rarefaction wave (fan) arises since the characteristics issued from $a_0 \leq x(1) < 0$ and $0 < x(1)$ are splitting. The left limit of the rarefaction fan meets the shock wave if the characteristic issued from $x(1) = 0$ crosses the shock-wave with speed $a_0$ at some time $t_1$, such that $x(t_1) = 1-t_1 = a_0 t_1$, i.e.
$$
t_1 = \frac{1}{1+a_0} = 4/3 \, .
$$
(b.ii) The rarefaction solution is given by $u(x,t) = {f'}^{-1}\!\left(\frac{x}{t-1}\right)$. Therefore, for $1<t<t_1$, the solution is
$$
u(x,t) = \left\lbrace
\begin{aligned}
&1/4 &&\mathrm{if}\quad x < a_0 t \, , \\
&1 &&\mathrm{if}\quad a_0 t < x \leq 1-t \, , \\
&\frac{1}{2}\frac{t-1 -x}{t-1} &&\mathrm{if}\quad 1-t \leq x \leq t-1 \, .\\
&0 &&\mathrm{if}\quad t-1 < x \, .\\
\end{aligned}
\right.
$$
For times $t>t_1$, the shock-wave results from the crossing of the characteristics issued from $x(1)<a_0$ and the rarefaction wave. It remains to determine the position $y(t)$ of the discontinuity. On the right of the shock trajectory $(y(t),t)$, we have the data coming from the rarefaction, and on the left, we have the data $u=1/4$. Therefore, the Rankine-Hugoniot condition writes
$$
y'(t) = \frac{f\left(\frac{1}{2}\frac{t-1 - y(t)}{t-1}\right) - f(1/4)}{\frac{1}{2}\frac{t-1 - y(t)}{t-1} - 1/4} \, ,
$$
with the initial condition $y(t_1) = a_0 t_1$. Solving this differential equation gives the trajectory of the discontinuity.
