## 1D Traffic Flow Problem

Folks,
A one dimensional traffic flow model is given by

$\displaystyle \frac{\partial \rho}{\partial t}+(1-2 \rho)\frac{\partial \rho}{\partial x}=0$ where $\rho(x,t)$ is the density of the traffic.
Find the solution given that

$\rho(x,t)=\begin{cases}0, x<0 \\ x, 0 \le x \le 1 \\ 1, x>1\end{cases}$

I calculate the following. THe general solution is $\rho(x,t)=f(x- c(\rho)t)$ where

$c(\rho) = (1-2\rho) \implies \rho(x,t)=f(x-(1-2\rho)t)$. Therefore the solution is

$f(x-(1-2\rho)t)=\begin{cases}0, (1-2\rho)t<0 \\ (1-2 \rho), 0 \le (1-2 \rho)t) \le 1 \\ 1, (1-2 \rho)t>1\end{cases}$

I dont really understand whats goin on above as I have just replaced x with $(1-2 \rho)t$

Thanks