| SOCR ≫ | TCIU Website ≫ | TCIU GitHub ≫ |
The previous animation can be generated via Mathematica. Note that, once we have established the PBC conditions, the initial condition cannot be arbitrarily prescribed. PBC have to be
Linear combinations of trigonometric sine function, and
The frequency terms for time and space should be an integer multiple of 2Pi/(Length of interval). In this case it is \(\pi\).
Here is the Mathematica code to model this solution (users may need to add a specific local export directory at the end).
eqn = Derivative[2, 0][u][x, t] == D[D[u[x, t], t], t];
(*The coefficient in Cosine must be a multiple of Pi*)
init1 = u[x, 0] == Cos[Pi*x];
init2 =
\!\(\*SuperscriptBox[\(u\),
TagBox[
RowBox[{"(",
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, 0] == -Pi*Sin[Pi*x];
(*Two initial conditions, Two boundary conditions*)
bon1 = u[-1, t] == u[1, t];
bon2 = (D[u[x, t], x] /. x -> -1) == (D[u[x, t], x] /. x -> 1);
usol = NDSolveValue[{eqn, init1, init2, bon1, bon2},
u, {x, -1, 1}, {t, 0, 5}];
fr = Table[
Plot[usol[x, t], {x, -1, 1}, PlotLegends -> Automatic,
PlotLabel -> (HoldForm["Time:"]) == t], {t, 0, 5, 0.2}];
Export["(*)", fr,
"DisplayDurations" -> 0.3, "AnimationReptitions" -> 20,
ImageSize -> 800];Several alternative example to tease out the dynamics assuming same periodic boundary condition
\[u(x,0)=Cos(\pi x), u_x(x,0)=-4\pi Sin(\pi x)\]
\[u(x,0)=Cos(\pi x) + Sin(3 \pi x), u_x(x,0)=-\pi Sin(\pi x) + 2\pi Cos(3 \pi x)\]
\[u(x,0)=Cos(\pi x) + Sin(3 \pi x)+Cos(5\pi x), u_x(x,0)=-\pi Sin(\pi x) + 2\pi Cos(3 \pi x)+Sin(5\pi x)\]
Next, we formalize a problem for the ultrahyperbolic equation with 2 time dimensions and 2 spatial dimensions, with periodic boundary conditions constrained on 2D spatial and 2D time dimensions.
\[ \Delta_x u = \Delta_t u, \text{ where } x\in[-\frac{1}{2},\frac{1}{2}]\times[-\frac{1}{2},\frac{1}{2}]\subset\mathbb{R}^2, t\in [0,5]\times[0,5]\subset\mathbb{R}^2\] \[u(-\frac{1}{2},x_2,t_1,t_2)=u(\frac{1}{2},x_2,t_1,t_2),u_{x_1}(-\frac{1}{2},x_2,t_1,t_2)=u_{x_1}(\frac{1}{2},x_2,t_1,t_2)\] \[u(x_1,-\frac{1}{2},t_1,t_2)=u(x_1,\frac{1}{2},t_1,t_2),u_{x_2}(x_1,-\frac{1}{2},t_1,t_2)=u_{x_2}(x_1,\frac{1}{2},t_1,t_2)\] \[u(x_1,x_2,0,t_2)=u(x_1,x_2,5,t_2),u_{t_1}(x_1,x_2,0,t_2)=u_{t_1}(x_1,x_2,5,t_2)\] \[u(x_1,x_2,t_1,0)=u(x_1,x_2,t_1,5),u_{t_2}(x_1,x_2,t_1,0)=u_{t_2}(x_1,x_2,t_1,5)\] In polar kime coordinates, we have a slightly different formulation \[\Delta_x u = \frac{\partial^2}{\partial r^2} u+\frac{1}{r}\frac{\partial}{\partial r}u+\frac{1}{r^2}\frac{\partial^2}{\partial \phi^2}u,\text{ where } (r,\phi)\in [0,5]\times[-\pi,\pi]\]
Instead of directly solving the polar kime problem, we transform the solution using Cartesian to polar coordinate transformations:
\[u(x,t)=e^{2\pi i(x_1\xi_1+x_2\xi_2+x_3\xi_3+\eta_1 rcos\phi+ \eta_2 rsin\phi) }, \xi_1,\xi_2,\xi_3,\eta_1,\eta_2\in \mathbb{Z} \]
\[[-1,1]\times[-1,1]\times[-5,5]\times[-5,5] \overset{\small{determines}}{\Longrightarrow} [-1,1]\times[-1,1]\times[0,5]\times(-\pi,\pi)\]
However, the boundary condition is not necessarily determined by the boundary conditions in polar coordinates, but rather by the boundary conditions on the hypercube that “circumscribes” such circle.
Strictly speaking, for the interval
\[[-1,1]^{ds} \quad and \quad [-1,1]^{dt}\]
the solution should be
\[u(x,t)=e^{\pi i(x_1\xi_1+x_2\xi_2+x_3\xi_3+\eta_1 rcos\phi+ \eta_2 rsin\phi) }, \xi_1,\xi_2,\xi_3,\eta_1,\eta_2\in \mathbb{Z} \]
In the following animation we scale the solution by a factor of 2. That is,
\[u(x,t)=e^{2\pi i(x_1\xi_1+x_2\xi_2+x_3\xi_3+\eta_1 rcos\phi+ \eta_2 rsin\phi) }, \xi_1,\xi_2,\xi_3,\eta_1,\eta_2\in \mathbb{Z} \]
will still solve the periodic boundary condition on the [-1,1] hypercube.
Let’s visualize the solution in terms of the kime phase coordinates. The setup is
\[\xi=(\xi_1,\xi_2,\xi_3)=(-3,2,0), \eta=(\eta_1,\eta_2)=(-2,3), (x_1,x_2,t,\phi):[-1,1]\times[-1,1]\times[0,5]\times(-\pi,\pi)\]
Note: The rendering of this animation takes about 8-12 hours to run.
eta = {-2, 3};
chsi = {-3, 2};
mp[\[Theta]_, x_, y_, t_] =
Exp[2*Pi*I*t*
Inner[Times, eta, {Cos[\[Theta]], Sin[\[Theta]]}, Plus]]*
Exp[2*Pi*I*Inner[Times, chsi, {x, y}, Plus]];
fr = Table[
Show[ContourPlot3D[
Re[mp[\[Theta], x, y, 1]], {x, -1, 1}, {y, -1,
1}, {\[Theta], -\[Pi], \[Pi]},
RegionFunction ->
Function[{x, y, \[Theta]}, x^2 + y^2 <= 1],
Contours -> {-0.5, 0, 0.5},
ContourStyle -> Opacity[0.1]],
SliceContourPlot3D[Re[mp[\[Theta], x, y, 1]],
x == -1, {x, -1, 1}, {y, -1,
1}, {\[Theta], -\[Pi], \[Pi]}],
SliceContourPlot3D[Re[mp[\[Theta], x, y, 1]],
y == 1, {x, -1, 1}, {y, -1,
1}, {\[Theta], -\[Pi], \[Pi]}]], {t, 0, 5, 0.5}];
Export["C:\\(*Put your directory here*).gif", fr,
"DisplayDurations" -> 0.3, "AnimationRepetitions" -> 10,
ImageSize -> 800];In this section, we examine the dynamics of the wave equation solution with respect to each of the two kime dimensions in Cartesian coordinates, where k1 and k2 range from (0,5).
In this example, we slice the 3D domain using three planes: 1) the xy-plane (the intrinsic spatial dimension), (2) the yz-plane (the dynamics corresponding to spatial dimension y and varying k2), and (3) the xz plane(the dynamics corresponding to spatial dimension x and varying k2). The time dimension k1 and k2, correspond to t and s. The k1 dimension is intrinsic in the time dimension that we perceive, and can be demonstrated by the successive pictures generated in Mathematica. The setup is
\[\xi = (\xi_1,\xi_2,\xi_3)=(-3,2,0),\eta=(\eta_1,\eta_2)=(-2,3)\]
eta = {-2, 3};
chsi = {-3, 2};
u[s_, x_, y_, t_] =
Exp[2*Pi*I*Inner[Times, eta, {t, s}, Plus]]*
Exp[2*Pi*I*Inner[Times, chsi, {x, y}, Plus]];
fr1 = Table[
SliceContourPlot3D[Re[u[s, x, y, t]],
"CenterPlanes", {x, -1, 1}, {y, -1, 1}, {s, 0, 5},
PlotLegends -> Automatic], {t, 0, 5, 0.1}];
Export["C:\\(*Put your directory here*).gif", fr1,
"DisplayDurations" -> 0.3, "AnimationRepetitions" -> 10,
ImageSize -> 800];