I am trying to used NDsolve to solve Nonlinear Schroedinger Equation:
NDSolve[{I D[u[x, t], t] == -0.5*D[u[x, t], x, x] + 0.5*x^2*u[x, t] +
Abs[u[x, t]]^2 u[x, t], u[x, 0] == Exp[I*x]}, u, {t, 0, 2}, {x, 0,
2}]
The above step is not working, I need to get the value of u may be real and imaginary and plot3D for both.
Thanks
u[x, 0]
in the equations... where is the equals sign?u[x, 0] == ...
? Same thing forExp[I*x]
. $\endgroup$NDSolve
. I know you're solving problem defining in open domain and in traditional math the b.c. isn't often explicitly given, but b.c.s approximating the open boundary is necessary for numeric calcalation, see e.g. this. You'll find even more related question under boundary-condition-at-infinity. $\endgroup$