I am currently to numerically solve the following differential equation for the profile of global vortices with a simple complex scalar field:
y''[x] + y'[x]/x - y[x]/x^2 + (1 - y[x]^2) y[x] == 0,
y[0] == 0, y[Infinity] == 1.
This is my following code in Mathematica to try and obtain the solution.
inf = 100;
eqn = y''[x] + y'[x]/x - y[x]/x^2 + (1 - y[x]^2) y[x] == 0;
NDSolve[{eqn, y[0] == 0, y[inf] == 1}, y, {x, 0, 10}]
Unfortunately, Mathematica's NDSolve function gives the following errors due to infinities being obtained:
Power::infy: Infinite expression 1/0.^2 encountered.
Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.
Power::infy: Infinite expression 1/0. encountered.
Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.
Power::infy: Infinite expression 1/0.^2 encountered.
General::stop: Further output of Power::infy will be suppressed during this calculation.
Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.
General::stop: Further output of Infinity::indet will be suppressed during this calculation.
NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 0.`.
I have tried to specify the method of NDSolve to the "Shooting" method but this yields similar problems. I know this form of differential equation can be solved numerically to give profiles such as the ones given in the figure below.
In this plot y[x] is simply labelled f and x is equivalent to r, k is the co-efficient of the third term, -y[x]/x^2, which I have taken to be equal to 1 for convenience. The singularity at x = 0 can be avoided by an appropriate solution y[x].
I am therefore wondering how Mathematica can be used to obtain similar results. Any help on this matter would be greatly appreciated.
Power::infy
error comes from dividing byx == 0
. I don't think that's the whole problem, though. $\endgroup$