Welcome to our community

Be a part of something great, join today!

space time diagram Mathematica

dwsmith

Well-known member
Feb 1, 2012
1,673
How can I make a space time diagram in Mathematica for:
Consider the quasi-linear 1-D wave equation
$$
\frac{\partial\rho}{\partial t} + 2\rho\frac{\partial\rho}{\partial x} = 0
$$
with the piecewise constant initial conditions
$$
\rho(x,0) = \begin{cases}
\rho_1, & x < -x_0\\
\rho_2, & -x_0 < x < x_0\\
\rho_3, & x > x_0
\end{cases}
$$
where $\rho_1 > \rho_2 > \rho_3$ and $\rho_i, x_0\in\mathbb{R}$ with $i = 1, 2, 3$.




Argue that two shocks form at $x = \pm x_0$ in this case and sketch the space-time diagram for the density field.


Let
\begin{alignat*}{3}
\frac{dt}{dr} & = & 1\\
\frac{dx}{dr} & = & 2\rho\\
\frac{d\rho}{dr} & = & 0
\end{alignat*}
Then we obtain $t(r) = r$, $x(r) = 2\rho r + x_0$, and $\rho(r) = c$ when $t = 0$.
Since we have that $t = r$, we can make the substitution
$$
x = 2t\rho + x_0.
$$
Let's put the equation in the form of $y = mx + b$ or in our case $t = mx + x_0$.
So we have
$$
t = \frac{x - x_0}{2\rho}.
$$
A shock will occur when two characteristic lines intersect or there is a jump discontinuity.
To view that $\pm x_0$ causes shock, for simplicity, let $x_0 = 1$, $\rho_1 = 3$, $\rho_2 = 2$, and $\rho_3 = 1$.
Then the characteristic lines are
\begin{alignat*}{5}
t & = & \frac{x - 1}{6}, & \ \ \text{for} & \ \ x < -1\\
t & = & \frac{x - 1}{4}, & \ \ \text{for} & \ \ -1 < x < 1\\
t & = & \frac{x - 1}{2}, & \ \ \text{for} & \ \ x > 1
\end{alignat*}
At $-x_0 = -1$, we have $t = \frac{-1}{3}$ and $t = \frac{-1}{2}$.
Therefore, we have a jump discontinuity at $-x_0$.
For $x_0 = 1$, $t = 0$, i.e. we have two intersecting characteristic lines.
Since the choice of $x_0$ and $\rho$ were arbitrary, $\pm x_0$ will cause a shock for all choices.