# Shock formation in traffic flow equation

Consider the PDE initial value problem $$\frac{\partial u}{\partial t}+(1-2u)\frac{\partial u}{\partial x}=0,$$ $$u(x,0)=f(x),$$ with the initial conditions for traffic congestion:

$$f(x)=\begin{cases} \frac{1}{3} & \text{if }\left|x\right|\ge 1\\ \frac{1}{2}\left( \frac{5}{3}-\left| x \right| \right) &\text{if } \left|x\right|\le 1\\ \end{cases}$$

This equation can be solved by the method of characteristics to obtain $$u(x,t)=f(x)+f(x-t(1+2u))$$

Now to find the time $t_s$ and position $x_s$ of the initial shock formation, we can do the following:

$$u(x,t) = f(x)+f(\tau)$$ $$x=(1-2f(\tau))t+\tau$$ $$u_x(x,t) = f'(x) + f'(\tau)\tau_x$$ $$1=-2tf'(\tau)\tau_x+\tau_x=\tau_x(1-2tf'(\tau))$$ $$\tau_x=\frac{1}{1-2tf'(\tau)}$$ $$u_x = f'(x)+\frac{f'(\tau)}{1-2tf'(\tau)}$$

Now to find the time and position of the initial shock formation, we need

$$t_s=\min_\tau\left( -\frac{1}{f'(\tau)} \right)$$

But the question is: how do we find $f(\tau)$?

• Well if you have $f(x)$, $f(\tau)$ is the same, just replace $x$ by $\tau$ :-) Aug 7, 2016 at 4:52
• $x$ and $\tau$ are two completely different variables here. $\tau = x-(1-2u)t$. Aug 7, 2016 at 4:58
• If you last equation is filly correct (I didn't check the above math), it does not matter. What matters is the definition of $f$. You can express $f'$ "easily" from the definition of $f$, then plug that in the last equation, find it's minimum (if any/if it exists) by minimizing over $\tau$ and that will give you $t_s$. I didn't fully understand the math above though so maybe the last equation means different to you. Aug 7, 2016 at 5:21
• @sequence : did you check if your result $u(x,t)=f(x)+f(x-t(1+2u))$ agrees with the PDE ? You just have to put it into the PDE and see if it is satisfied. If you had done this check, you would have seen that your result is false. Aug 7, 2016 at 7:33
• Now, $u(x,t)=f(x-t(1-2u))$ is OK. In the wording of your question, you should correct the equation $u(x,t)=f(x)+f(x-t(1+2u))$ which is false : why is there $f(x)$ in it ?. Aug 7, 2016 at 7:55

The general solution of the PDE is : $$u(x,t)=F(x-t(1-2u))$$ where $F$ is any differentiable function.
Do not confuse $F$ with $f$ appearing in the initial condition : $$f(x)=\begin{cases} \frac{1}{3} & \text{if }\left|x\right|\ge 1\\ \frac{1}{2}\left( \frac{5}{3}-\left| x \right| \right) &\text{if } \left|x\right|\le 1\\ \end{cases}$$ The initial condition is : $u(x,0)=F(x)=f(x)$ which determines $F$ as : $$F(X)=\begin{cases} \frac{1}{3} & \text{if }\left|X\right|\ge 1\\ \frac{1}{2}\left( \frac{5}{3}-\left| X \right| \right) &\text{if } \left|X\right|\le 1\\ \end{cases}$$ In the particular solution fitting to the initial condition, $X\neq x$ but $X=x-t(1-2u)$ $$u(x,t)=\begin{cases} \frac{1}{3} & \text{if }\left|x-t(1-2u)\right|\ge 1\\ \frac{1}{2}\left( \frac{5}{3}-\left| x-t(1-2u) \right| \right) &\text{if } \left|x-t(1-2u)\right|\le 1\\ \end{cases}$$ You see that it is very different from the cases $|x|\ge 1$ and $|x|\le 1$ because $u$ is involved into them.
This is a sketch of the characteristic curves $x(t) = (1-2f(x_0))t+x_0$ in the $x$-$t$ plane:
Characteristics seem to intersect at $t=1$. This can be recovered via the expression of the breaking time \begin{aligned} t_s &= \frac{-1}{\min\, (1-2f)'(x)} \\ &= \frac{1/2}{\max f'(x)} \\ &= 1 \, . \end{aligned}