# Variation of Lighthill-Whitham-Richards Traffic PDE: Finding Boundary Characteristics/Shocks

Reading a bit about Lighthill-Whitham-Richards (LWR) Traffic PDEs, and I've realize I don't quite understand how to introduce shocks when a PDE has both an initial and boundary condition.

I propose a simple example:

Example. Define the following LWR with initial and boundary conditions \begin{align} &u_t + 2uu_x = 0 \\ &u(x,0) = 1,\quad x > 0\\ &u(0,t) = 2,\quad 0 < t < 1\\ &u(0,t) = 1,\quad t > 1 \end{align}

What I understand: We use the Method of Characteristics to solve, i.e.

$$\frac{dt}{1} = \frac{dx}{2u} = \frac{du}{0}.$$

From this it is easy to see that we get the implicit solution, $$u(x,t) = F(x-tu)$$. For the initial condition, we have characteristic curve, $$x = tF(s) + s$$. For $$s > 0$$, we get that $$F(s) = 1$$, and so

$$x = t + s \quad\Rightarrow\quad s = x - t \quad\Rightarrow\quad u(x,t) = 1,~ x > t.$$

Issue: So, now we look at the BP. Then using the same characteristic, $$x = tF(s) + s$$, we get \begin{align} 0 < t < 1 &\quad\Rightarrow\quad F(s) = 2 &\quad\Rightarrow\quad s = x - 2t &\quad\Rightarrow\quad u(x,t) = 2,~2t < x < 1 + 2t. \\ t > 1 &\quad\Rightarrow\quad F(s) = 1 &\quad\Rightarrow\quad s = x - t &\quad\Rightarrow\quad u(x,t) = 1,~x > 1 + t. \end{align}

I don't known how to visualize these in the $$x-t$$ plane (below line $$x = t$$), so that I can introduce shocks (two of them I think?). My picture so far would be:

One needs to be careful when applying the initial/boundary conditions for the Lagrange-Charpit system $$\frac{dt}{1} = \frac{dx}{2u} = \frac{du}{0} ,$$ which gives $$u = C_1$$ and $$x = 2ut+C_2$$. The previous equations yield $$u = C_1 = F(C_2) = F(x - 2u t)$$ or equivalently $$u = C_1 = G\big({-\tfrac{C_2}{2C_1}}\big) = G(t-x/(2u)) \, .$$ We may rewrite the equation of characteristic curves starting from the initial condition as $$x = 2u t + x_0$$, along which $$u = F(x_0)$$ is uniformly equal to the value $$u(x_0,0)$$. The equation of characteristic curves starting from the boundary condition reads $$t = x/(2u) + t_0$$ where $$u = G(t_0)$$ is uniformly equal to the value $$u(0,t_0)$$. Here is what the curves look like:
To determine the shock and rarefaction waves, you will need to use the conservative form obtained by substituting $$2uu_x = (u^2)_x$$. Note that the Lighthill-Witham-Richards traffic flow model may be recovered if we set $$u = \frac12 - \rho$$ where $$0\leq \rho\leq 1$$ is the car density, so that $$u_t + 2u u_x = -[\rho_t + (1 - 2\rho) \rho_x] = 0 \, .$$ Hence, the proposed values of $$u$$ in the problem statement aren't representative of a physical configuration.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 27, "wp-katex-eq": 0, "align": 2, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/3935561/variation-of-lighthill-whitham-richards-traffic-pde-finding-boundary-characteri", "fetch_time": 1618640172000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2021-17/segments/1618038101485.44/warc/CC-MAIN-20210417041730-20210417071730-00249.warc.gz", "warc_record_offset": 507045614, "warc_record_length": 38519, "token_count": 897, "char_count": 2670, "score": 3.890625, "int_score": 4, "crawl": "CC-MAIN-2021-17", "snapshot_type": "latest", "language": "en", "language_score": 0.8010039925575256, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00039-of-00064.parquet"}