In[]:=
Clear["Global`*"]
Define the initial condition
In[]:=
f[x_]=Exp[-x^2]
Out[]=
-
2
x

the corresponding solution to solve the linear Schrödinger equation
u
t
(x,t)i*v*
u
xx
(x,t), -∞<x<+∞,t>0,v>0
u(x,0)f(x)
it is given by the function
​
u(x,t)
1
4
+infty
∫
-∞
f(y)
-
iπ
4
+
i
2
(x-y)
4vt
e
dy,t>0
In[]:=
u[x_,t_,v_]=Integrate[(Exp[-(I*Pi)/(4)+I*(x-y)^2/(4*v*t)])*f[y],{y,-Infinity,Infinity},Assumptions{v>0,t>0}]/(Sqrt[4Pi*v*t])
Out[]=
(1-)
2
x
-1-4tv

2
4-

tv
tv

Greaphs for Re[u[x, t, 0.25]], Re[u[x, t, 0.5]]

In[]:=
eik1=Plot3D[Re[u[x,t,0.25]],{x,-25,25},{t,0.05,30},PlotRangeAll,PlotPoints->250]
In[]:=
eik2=Plot3D[Re[u[x,t,0.5]],{x,-25,25},{t,0.05,30},PlotRangeAll,PlotPoints->250]

Greaphs for Im[u[x, t, 0.25]], Im[u[x, t, 0.5]]

In[]:=
eik3=Plot3D[Im[u[x,t,0.25]],{x,-25,25},{t,0.05,30},PlotRangeAll,PlotPoints->250]
In[]:=
eik4=Plot3D[Im[u[x,t,0.5]],{x,-25,25},{t,0.05,30},PlotRangeAll,PlotPoints->250]

Greaphs for Abs[u[x, t, 0.25]]^2, Abs[u[x, t, 0.5]]^2

In[]:=
eik5=Plot3D[Abs[u[x,t,0.25]]^2,{x,-25,25},{t,0.05,30},PlotRangeAll,PlotPoints->250]
General
:
2
1.77901×
-271
10
is too small to represent as a normalized machine number; precision may be lost.
Out[]=
In[]:=
eik6=Plot3D[Abs[u[x,t,0.5]]^2,{x,-25,25},{t,0.05,30},PlotRangeAll,PlotPoints->250]
General
:
2
1.85986×
-269
10
is too small to represent as a normalized machine number; precision may be lost.
Out[]=
In[]:=
Limit[u[x,t,0.25],tInfinity]
Out[]=
0.+0.
In[]:=
Plot[Evaluate[Table[Re[u[x,t,0.25]],{t,0.05,30,2}]],{x,-25,25},PlotRangeAll,AxesLabel{x,u},PlotStyleThick,ImageSize500]​​​​Plot[Evaluate[Table[Re[u[x,t,0.5]],{t,0.05,30,2}]],{x,-25,25},PlotRangeAll,AxesLabel{x,u},PlotStyleThick,ImageSize500]
For large values of ν, propagation is faster

Now we are going to solve the above problem numerically

(*Fouriertranformfortheequation
u
t
(x,t)=i*v*
u
xx
(x,t)*)
FourierSinTransform[D[u[x,t],{t,1}],x,ω]==FourierSinTransform[I*v*D[u[x,t],{x,2}],x,ω,FourierParameters{1,-1}]
Out[]=
FourierSinTransform
(0,1)
u
[x,t],x,ωvω(-ωFourierSinTransform[u[x,t],x,ω]-2u[0,t])
We define the transformed equation
In[]:=
ode=D

u
[ω,t],{t,1}I*v*ω*-ω*

u
[ω,t]-2*T0;
Now we use the command DSolve
In[]:=
sol=DSolveode,

u
[ω,t],t
Out[]=


u
[ω,t]-
2T0
ω
+
-tv
2
ω


1

We need now to calculate the coefficient c1. We use the same initial condition f[x_]=Exp[-x^2] and we calculate the Fourier Sine Transform as follows
​
In[]:=
FourierSinTransform[u[x,0],x,ω]==FourierSinTransform[f[x],x,ω,FourierParameters{1,-1}]
Out[]=
FourierSinTransform[u[x,0],x,ω]-2DawsonF
ω
2

Thus the transformed I . C is
In[]:=
ic=

u
[ω,0]==FourierSinTransform[f[x],x,ω,FourierParameters{1,-1}]
Out[]=

u
[ω,0]-2DawsonF
ω
2

In[]:=
sol=DSolve{ode,ic},

u
[ω,t],t
Out[]=


u
[ω,t]-
2
-tv
2
ω

-T0+
tv
2
ω

T0+ωDawsonF
ω
2

ω

Now we define the solution as
In[]:=

u
[ω_,t_]=-
2
-tv
2
ω

-T0+
tv
2
ω

T0+ωDawsonF
ω
2

ω
Out[]=
-
2
-tv
2
ω

-T0+
tv
2
ω

T0+ωDawsonF
ω
2

ω
And the solution of our initial problem is
In[]:=
u[x_,t_]=InverseFourierSinTransform

u
[ω,t],ω,x,FourierParameters{1,-1},Assumptions{x>0}
Out[]=
InverseFourierSinTransform-
2
-tv
2
ω

-T0+
tv
2
ω

T0+ωDawsonF
ω
2

ω
,ω,x,FourierParameters{1,-1},Assumptions{x>0}
In[]:=
T0=1;​​Plot[Abs[u[x,t]]^2,{x,0,20},PlotRangeAll]
NIntegrate
:The integrand
2
-tv
2
(0.+ω)

-1+
tv
2
(0.+ω)

+(0.+ω)DawsonF
1
2
(0.+ω)Sin[0.000408571ω]
0.+ω
has evaluated to non-numerical values for all sampling points in the region with boundaries {{∞,0.}}.
NIntegrate
:The integrand
2
-tv
2
(0.+ω)

-1+
tv
2
(0.+ω)

+(0.+ω)DawsonF
1
2
(0.+ω)Sin[0.000408571ω]
0.+ω
has evaluated to non-numerical values for all sampling points in the region with boundaries {{∞,0.}}.
NIntegrate
:The integrand
2
-tv
2
(0.+ω)

-1+
tv
2
(0.+ω)

+(0.+ω)DawsonF
1
2
(0.+ω)Sin[0.000408571ω]
0.+ω
has evaluated to non-numerical values for all sampling points in the region with boundaries {{∞,0.}}.
General
:Further output of NIntegrate::inumr will be suppressed during this calculation.