1
$\begingroup$

This program runs fine and I am able to get eigenvalues and eigenfunctions, however, I want to give a range of values for x and y. Can you suggest, how to edit my code for that?

 \[ScriptCapitalR] = ImplicitRegion[x^2 + y^2 <= 1, {x, y}];

V[x_, y_] = If[{x, y} \[Element] Region[\[ScriptCapitalR]], 0, \[Infinity]];

{vals, funs} = NDEigensystem[{-Laplacian[u[x, y], {x, y}] + V[x, y]*u[x, y],DirichletCondition[u[x, y] == 0, True]}, u, {x, y} \[Element] Region[\[ScriptCapitalR]], 10, Method -> {"SpatialDiscretization" -> {"FiniteElement",\{"MeshOptions" -> {MaxCellMeasure -> 0.01}}}}];
$\endgroup$
6
  • $\begingroup$ On what should the range depend? $\endgroup$
    – user21
    Commented Jan 11, 2022 at 6:35
  • $\begingroup$ range should depend on x and y $\endgroup$
    – user444
    Commented Jan 11, 2022 at 7:03
  • $\begingroup$ Well, yes, but how? $\endgroup$
    – user21
    Commented Jan 11, 2022 at 8:25
  • $\begingroup$ I need to specify a range of the values for x and y where I am writing {x,y} are elements of Region[R], in the last line. $\endgroup$
    – user444
    Commented Jan 18, 2022 at 4:37
  • $\begingroup$ Still unclear what you want to do, show the code that does not work. Maybe it is possible to infer what you would like to do from that. $\endgroup$
    – user21
    Commented Jan 18, 2022 at 5:58

1 Answer 1

2
$\begingroup$
\[ScriptCapitalR] = ImplicitRegion[x^2 + y^2 <= 1, {x, y}];

V[x_, y_] = 
  If[{x, y} \[Element] Region[\[ScriptCapitalR]], 0, \[Infinity]];

{vals, funs} = 
  NDEigensystem[{-Laplacian[u[x, y], {x, y}] + V[x, y]*u[x, y], 
    DirichletCondition[u[x, y] == 0, True]}, 
   u, {x, y} \[Element] Region[\[ScriptCapitalR]], 10];

Table[Plot3D[
  funs[[i]][x, y], {x, y} \[Element] \[ScriptCapitalR]], {i, 10}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.