I am trying to solve the linear Schrödinger equation with Fourier transform as follows. Although analytically I was able to solve it and create the graphs I wanted. I have difficulty making the corresponding graph when I solve the problem numerically. Can you explain to me what is my mistake in the following code?
Analytical solution
Clear["Global`*"]
f[x_] = Exp[-x^2]
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[4 Pi*v*t])
eik5 = Plot3D[Abs[u[x, t, 0.25]]^2, {x, -25, 25}, {t, 0.05, 30},
PlotRange -> All, PlotPoints -> 250]
Numerical solution
(* Fourier tranform for the equation Subscript[u, \
t](x,t)=i*v*Subscript[u, xx](x,t) *)
FourierSinTransform[ D[u[x, t], {t, 1}], x, \[Omega]] ==
FourierSinTransform[ I*v* D[u[x, t], {x, 2}], x, \[Omega],
FourierParameters -> {1, -1}]
ode = D[
\!\(\*OverscriptBox[\(\(\ \ \)\(u\)\), \(^\)]\)[\[Omega], t], {t,
1}] == I*v*\[Omega]*(-\[Omega]*
\!\(\*OverscriptBox[\(u\), \(^\)]\)[\[Omega], t] - 2*T0);
sol = DSolve[ode,
\!\(\*OverscriptBox[\(u\), \(^\)]\)[\[Omega], t], t]
FourierSinTransform[u[x, 0], x, \[Omega]] ==
FourierSinTransform[f[x], x, \[Omega], FourierParameters -> {1, -1}]
ic =
\!\(\*OverscriptBox[\(u\), \(^\)]\)[\[Omega], 0] ==
FourierSinTransform[f[x], x, \[Omega], FourierParameters -> {1, -1}]
sol = DSolve[{ode, ic},
\!\(\*OverscriptBox[\(u\), \(^\)]\)[\[Omega], t], t]
\!\(\*OverscriptBox[\(u\), \(^\)]\)[\[Omega]_, t_] = -((
2 E^(-I t v \[Omega]^2) (-T0 +
E^(I t v \[Omega]^2)
T0 + \[Omega] DawsonF[\[Omega]/2]))/\[Omega])
u[x_, t_] = InverseFourierSinTransform[
\!\(\*OverscriptBox[\(u\), \(^\)]\)[\[Omega], t], \[Omega], x,
FourierParameters -> {1, -1}, Assumptions -> {x > 0}]
T0 = 1;
Plot[Abs[u[x, t]]^2, {x, 0, 20}, PlotRange -> All]
You can download the notebook of my project from Wolfram Community