I am trying to solve the following problem using Mathematica's NDSolve

$$ \partial^2_{y}\psi+\partial^2_{x}\psi-2\,i\,q\,B\,y\,\partial_{y}\psi-q^2B^2y^2\psi+q\,B\,\psi=0 $$

subject to the boundary conditions

$$ \psi(x+L,y)=\psi(x,y)\quad\psi(x,y+L)=e^{i\,q\,B\,x\,L}\psi(x,y)\quad\text{and}\quad \mathrm{Re}(\psi(L/2,L/2))=1\,, $$


$$ q\,B=\frac{2\pi}{L^2}\,. $$

This problem has an exact solution for $\psi$ in terms of EllipticTheta functions.

For the moment, I was trying to impose $\mathrm{Re}(\psi(0,0))=0$, because it looks like a simpler thing to do (since the point $(0,0)$ belongs to the boundary of integration). I have attempted the following:

B = 2/q;
L = Sqrt[(2 \[Pi])/(q B)];
sol = NDSolveValue[{\!\(
\*SubscriptBox[\(\[PartialD]\), \(x, x\)]\(u[x, y]\)\) + \!\(
\*SubscriptBox[\(\[PartialD]\), \(y, y\)]\(u[x, y]\)\) - 2 I q B y \!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(u[x, y]\)\) - 
     q^2 B^2 y^2 u[x, y] +q B u[x, y]==0, 
   DirichletCondition[u[x, y] == 1, x == 0 && y == 0], 
   PeriodicBoundaryCondition[u[x, y], 0 <= y <= L && x == L, 
    FindGeometricTransform[{{0, 0}, {0, L}}, {{L, 0}, {L, L}}][[2]]], 
   PeriodicBoundaryCondition[Exp[I q B L x] u[x, y], 
    0 <= x <= L && y == L, 
    FindGeometricTransform[{{0, 0}, {L, 0}}, {{0, L}, {L, L}}][[2]]]},
   u, {x, y} \[Element] Rectangle[{0, 0}, {L, L}]]
Plot3D[Abs[sol[x, y]], {x, 0, L}, {y, 0, L}, PlotRange -> All]

NDSolve does return a function, but it does not look like the exact result. In case you are curious, the equation above appears when studying an Abrikosov lattice in two-dimensional superconductors of type II.

The exact solution with $\mathrm{Re}(\psi(0,0))=1$ given by

u[x_, y_] := (
 E^(-(1/2) B q x (x - 2 I y))
   EllipticTheta[3, -(1/2) I B L q (x - I y), E^(-(1/2) B L^2 q)])/
 EllipticTheta[3, 0, E^(-(1/2) B L^2 q)]
  • $\begingroup$ Could you, please, show us exact solution? $\endgroup$ – Alex Trounev Apr 19 at 11:00
  • $\begingroup$ I have changed the quantisation condition for $B$ (there was a silly mistake there) and I have added the exact solution as requested. $\endgroup$ – user12588 Apr 19 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.