Space time diagram Mathematica

In summary, the conversation discusses the creation of a space-time diagram in Mathematica for the quasi-linear 1-D wave equation with piecewise constant initial conditions. It is argued that two shocks form at $x = \pm x_0$ and a space-time diagram is sketched using Mathematica. It is shown that the choice of $x_0$ and $\rho$ are arbitrary and will always result in shock waves at $x = \pm x_0$.
  • #1
Dustinsfl
2,281
5
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.
 
Physics news on Phys.org
  • #2
Now, let's plot the space-time diagram for the density field. We will use Mathematica to plot the space-time diagram. We can use ParametricPlot to draw the characteristic lines.<code> ParametricPlot[{x, (x - 1)/(2*ρ)}, {x, -4, 4}, {ρ, 1, 3}, PlotStyle -&gt; {{Thick, Red}, {Thick, Blue}, {Thick, Green}}]</code>We can see that there are two shock waves at $x = \pm1$.
 

FAQ: Space time diagram Mathematica

What is a space-time diagram in Mathematica?

A space-time diagram in Mathematica is a graphical representation of the relationship between space and time in a particular physical system. It is typically used in physics and astronomy to visualize the motion and interactions of objects in a given space-time.

How is a space-time diagram created in Mathematica?

A space-time diagram can be created in Mathematica by using the built-in functions and commands specifically designed for plotting space-time diagrams. These functions include "SpaceTimePlot" and "SpaceTimeDiagram", which allow you to specify the coordinates, time intervals, and other parameters to customize your diagram.

What can a space-time diagram in Mathematica be used for?

A space-time diagram in Mathematica can be used for a variety of purposes, such as understanding the behavior of particles in a gravitational field, studying the effects of relativity on moving objects, and visualizing the trajectories of objects in a multi-dimensional space-time.

Can a space-time diagram be animated in Mathematica?

Yes, a space-time diagram can be animated in Mathematica by using the "Animate" function, which allows you to vary the parameters of your space-time diagram and produce a series of frames that can be played as a movie.

Are there any limitations to creating a space-time diagram in Mathematica?

While Mathematica has powerful tools for creating space-time diagrams, there are some limitations to keep in mind. For example, the accuracy and complexity of the diagram may be impacted by the chosen coordinates and time intervals, and the computational resources required to create a large and detailed diagram may be significant.

Similar threads

Replies
10
Views
613
Replies
1
Views
2K
Replies
33
Views
787
Replies
2
Views
700
Replies
4
Views
2K
Replies
19
Views
1K
Replies
5
Views
2K
Replies
1
Views
1K
Back
Top