Skip to main content
format improved, missing parameters added.
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions. L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 10}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow"]

PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow"]

enter image description here

update

For completeness purposes only, this is the solution with the abc boundary condition from @xzczd.

w = 1;
L = 3;
c = 1;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] - 
     1/2 w^2 x^2 p[t, x] == 0, 
   p[0, x] == E^(-w (x - c)^2/2)*(w/Pi)^(1/4), 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}]Derivative[0, ")"}],
Derivative],
MultilineFunction->None]\)[t1][p][t, -L] - p[t, -L] == 0, 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}]Derivative[0, ")"}],
Derivative],
MultilineFunction->None]\)[t1][p][t, L] + p[t, L] == 0}, 
  p, {t, 0, 20}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 20}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow", 
 FrameLabel -> {"t", "x"}] 

enter image description here

Note how in the first case the wave function starts to diffuse as time passes, so it's not really a coherent state.

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions. L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 10}, {x, -L/2, L/2}, 

PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow"]

enter image description here

update

For completeness purposes only, this is the solution with the abc boundary condition from @xzczd.

usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] - 
     1/2 w^2 x^2 p[t, x] == 0, 
   p[0, x] == E^(-w (x - c)^2/2)*(w/Pi)^(1/4), 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, -L] - p[t, -L] == 0, 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, L] + p[t, L] == 0}, 
  p, {t, 0, 20}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 20}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow", 
 FrameLabel -> {"t", "x"}] 

enter image description here

Note how in the first case the wave function starts to diffuse as time passes, so it's not really a coherent state.

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions. L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 10}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow"]

enter image description here

update

For completeness purposes only, this is the solution with the abc boundary condition from @xzczd.

w = 1;
L = 3;
c = 1;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] - 
     1/2 w^2 x^2 p[t, x] == 0, 
   p[0, x] == E^(-w (x - c)^2/2)*(w/Pi)^(1/4), 
   Derivative[0, 1][p][t, -L] - p[t, -L] == 0, 
   Derivative[0, 1][p][t, L] + p[t, L] == 0}, 
  p, {t, 0, 20}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 20}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow", 
 FrameLabel -> {"t", "x"}] 

enter image description here

Note how in the first case the wave function starts to diffuse as time passes, so it's not really a coherent state.

improved the answer wit information from the comments
Source Link
tsuresuregusa
  • 2.7k
  • 2
  • 13
  • 31

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions. L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[DensityPlot[Norm@usol[t, x], {Re@usol[tt, 0, 10}, {x, -L/2, L/2}, 

PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow"]

enter image description here

update

For completeness purposes only, this is the solution with the abc boundary condition from @xzczd.

usol = NDSolveValue[{I D[p[t, x], Im@usol[tt] + 1/2 D[p[t, x], x, x] - 
     1/2 w^2 x^2 p[t, x] == 0, 
   p[0, x] == E^(-w (x - c)^2/2)*(w/Pi)^(1/4), 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, -L] - p[t, -L] == 0, 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, L] + p[t, L] == 0}, 
  p, {t, 0, 520}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 20}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 80]100, ColorFunction -> "Rainbow", 
 FrameLabel -> {"t", "x"}] 

enter image description hereenter image description here

Note how in the first case the wave function starts to diffuse as time passes, so it's not really a coherent state.

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions. L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[{Re@usol[t, x], Im@usol[t, x]}, {t, 0, 5}, {x, -L, L}, 
 PlotRange -> All, PlotPoints -> 80]

enter image description here

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions. L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 10}, {x, -L/2, L/2}, 

PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow"]

enter image description here

update

For completeness purposes only, this is the solution with the abc boundary condition from @xzczd.

usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] - 
     1/2 w^2 x^2 p[t, x] == 0, 
   p[0, x] == E^(-w (x - c)^2/2)*(w/Pi)^(1/4), 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, -L] - p[t, -L] == 0, 
\!\(\*SuperscriptBox[\(p\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, L] + p[t, L] == 0}, 
  p, {t, 0, 20}, {x, -L, L}]

DensityPlot[Norm@usol[t, x], {t, 0, 20}, {x, -L/2, L/2}, 
 PlotRange -> All, PlotPoints -> 100, ColorFunction -> "Rainbow", 
 FrameLabel -> {"t", "x"}] 

enter image description here

Note how in the first case the wave function starts to diffuse as time passes, so it's not really a coherent state.

added physics
Source Link
tsuresuregusa
  • 2.7k
  • 2
  • 13
  • 31

YourLet's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions.    L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[{Re@usol[t, x], Im@usol[t, x]}, {t, 0, 5}, {x, -L, L}, 
 PlotRange -> All, PlotPoints -> 80]

enter image description here

Your equation is missing a p[x,t] on the RHS besides the boundary conditions.  L also needs to be larger. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[{Re@usol[t, x], Im@usol[t, x]}, {t, 0, 5}, {x, -L, L}, 
 PlotRange -> All, PlotPoints -> 80]

enter image description here

Let's remember Schrodinger's equation:

$i\hbar\frac{\partial}{\partial t} \Psi(\mathbf{r},t) = \left [ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r},t)\right ] \Psi(\mathbf{r},t)$

For the harmonic oscilator $V = x^2$, so your equation is missing a p[x,t] on the RHS besides the boundary conditions.  L also needs to be larger too. This seems to work.

w = 2;
L = 10;
c = 3;
usol = NDSolveValue[{I D[p[t, x], t] + 1/2 D[p[t, x], x, x] == 
    1/2 w^2 x^2 p[t, x], 
   p[0, x] == Exp[(-w (x - c)^2/2)*(w/Pi)^(1/4)], p[t, L] == 0, 
   p[t, -L] == 0}, p, {t, 0, 10}, {x, -L, L}]

DensityPlot[{Re@usol[t, x], Im@usol[t, x]}, {t, 0, 5}, {x, -L, L}, 
 PlotRange -> All, PlotPoints -> 80]

enter image description here

Source Link
tsuresuregusa
  • 2.7k
  • 2
  • 13
  • 31
Loading