2
$\begingroup$

I am trying to solve a geometric problem with relation to my Schrödinger equation and its boundaries. Here is my code:

Clear["Global`*"];
m = 1;
ℏ = 1;
k = 1;
V = -k/Sqrt[1 + x^2 + y^2];

A = 8;
Δ = 10^-3;
SE[Etr_] := -ℏ^2/(2 m) \!\(
\*SubsuperscriptBox[\(∇\), \({x, y}\), \(2\)]\(ψ[x, y]\)\) +
V ψ[x, y] - Etr ψ[x, y] == 0

Ω = ImplicitRegion[x^2 + y^2 <= A^2, {x, y}];
BC = DirichletCondition[ψ[x, y] == Δ, 
   x^2 + y^2 == A^2];

Clear[Sol]
Sol = ParametricNDSolveValue[{SE[Etr], BC}, ψ[0, 
   0], {x, y} ∈ Ω, {Etr}]

Then when I insert a trial value for Etr, like so:

Sol[-0.5]

it gives a value but returns the following error:

ParametricNDSolve::femnr: "{x$54658,y$54659}\ [Element]ImplicitRegion[x$54658^2+y$54659^2<=64,{x$54658,y$54659}] is not a valid region specification."

Does anyone know how to fix this?

$\endgroup$
2
  • $\begingroup$ Sol[-0.5] works for me, although I get the error earlier, on the ParametricNDSolveValue call. The error doesn't stop a solution being produced. You might try Needs["NDSolveFEM"]; \[CapitalOmega] = ToElementMesh[ImplicitRegion[x^2 + y^2 <= A^2, {x, y}]]; and see if it works. I get no errors at any stage if I do that. $\endgroup$
    – Michael E2
    Mar 23, 2015 at 1:31
  • $\begingroup$ This is a bug. I have filed it as such and hope to have a fix soon. In the meanwhile the suggested workarounds seem good. $\endgroup$
    – user21
    Mar 23, 2015 at 14:20

1 Answer 1

2
$\begingroup$

Try this:

    Clear["Global`*"];
m = 1;
\[HBar] = 1;
k = 1;
V = -k/Sqrt[1 + x^2 + y^2];

A = 8;
\[CapitalDelta] = 10^-3;
SE[Etr_] := -\[HBar]^2/(2 m) \!\(
\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(\[Psi][x, y]\)\) +
   V \[Psi][x, y] - Etr \[Psi][x, y] == 0

\[CapitalOmega] = Disk[{0, 0}, A];
BC = DirichletCondition[\[Psi][x, y] == \[CapitalDelta], 
      x^2 + y^2 == A^2];

Clear[sol]
sol = ParametricNDSolve[{SE[Etr], 
   BC}, \[Psi], {x, y} \[Element] \[CapitalOmega], Etr]

I only replaced the definition of the domain Omega from the ImplicitRegion to simply a Disk, since Mma complained. All the rest is the same. After that you can visualize the solution as:

 Manipulate[
 Plot3D[Evaluate[\[Psi][Etr][x, y] /. sol], {x, 
    y} \[Element] \[CapitalOmega] , PlotRange -> All],
 {Etr, -0.6, 0}]

which looks like the image below

enter image description here

I do not know though, if this gives somehow the solution of the Scrödinger equation. It would be interesting to know, how do you cope with it?

Have fun!

$\endgroup$
1
  • $\begingroup$ Thank you, this gets rid of the error. But unfortunately, The solution doesn't change when I change the energy. This is unphysical. I am still trying to fix this. The circular boundary is giving me a lot of trouble it seems. Thanks again for your help! $\endgroup$
    – Karl
    Mar 25, 2015 at 15:01

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.