I tried to solve Schrödinger equation in 3D box using the NDEigensystem.
My code is:
{vals, funs} =
NDEigensystem[{-1/
2 (Div[Grad[u[x, y, z], {x, y, z}], {x, y, z}]),
DirichletCondition[u[x, y, z] == 0, True]},
u[x, y, z], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 2];
How I can extract the numerical values of the u[x,y,z]?
For example u[0,0,0?]
$\begingroup$
$\endgroup$
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
1
{vals, funs} = NDEigensystem[{-1/2 (Div[Grad[u[x, y, z], {x, y, z}], {x, y, z}]),
DirichletCondition[u[x, y, z] == 0, True]}, u[x, y, z],
{x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 2];
Then the value of u[0,0,0]
for the eigenstates are
Table[funs[[i, 0]][0, 0, 0], {i, Length[funs]}]
(* {0.353627, 0.000205384} *)
You can also plot the solution:
Table[DensityPlot3D[Abs@funs[[i]], {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
PlotRange -> All, PlotLabel -> vals[[i]],
ImageSize -> Medium], {i, Length[vals]}] // Row