This works:
NDSolveValue[{I D[u[z, x, y], z] + D[u[z, x, y], x, x] +
D[u[z, x, y], y, y] - (7*u[z, x, y])/(1 + Abs[u[z, x, y]]^2) == 0,
u[0, x, y] == E^-(x^2 + y^2),
u[z, -5, y] == 0, u[z, 5, y] == 0, u[z, x, -5] == 0,
u[z, x, 5] == 0
}, u, {z, 0, 4}, {x, -5, 5}, {y, -5, 5},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> "TensorProductGrid"}]
Note that I removed the derivative on z in the initial condition. Also I treated this as a time dependent problem. Since this a nonlinear equation the FEM in V11 can not handle that and you need to use the "TensorProductGrid". I have included the Dirichlet boundary conditions, you could also try something like this:
NDSolveValue[{I D[u[z, x, y], z] + D[u[z, x, y], x, x] +
D[u[z, x, y], y, y] - (7*u[z, x, y])/(1 + Abs[u[z, x, y]]^2) == 0,
u[0, x, y] == E^-(x^2 + y^2),
Derivative[0, 1, 0][u][z, -5, y] == 0,
Derivative[0, 1, 0][u][z, 5, y] == 0,
Derivative[0, 0, 1] u[z, x, -5] == 0,
Derivative[0, 0, 1] u[z, x, 5] == 0
}, u, {z, 0, 4}, {x, -5, 5}, {y, -5, 5},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid"}}]
But it correctly will give a message that the initial condition does not match the boundary condition, but perhaps that's OK in your case as NDSolve will try to find initial conditions that match.
- As you receive help, try to give it too, by answering questions in your area of expertise.
- Take the tour and check the faqs!
- When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Aug 24 '16 at 06:50