I am trying to solve the following nonlinear differential equation using the shooting method. The equation is a boundary value problem with boundary condition x[0]=Pi and x[Infinity]=0. In order to avoid singularity, I am using x[0.0001]=Pi and x[xmax]=0. My solution is okay up to some finite value like it is zero but after it gives oscillation. I don't need these oscillation and need zero just like before the oscillation started. My code is
sols13 = NDSolve[{x''[
r] + (1/r) x'[r] - (0.5/r^2) Sin[2 x[r]] + (2/r) Sin[x[r]]^2 -
0.2 Sin[x[r]] - Sin[2 x[r]] == 0, x[0.00001] == Pi,
x[100] == 0}, x[r], {r, 0.00001, 100},
Method -> {"Shooting",
"StartingInitialConditions" -> {x[0.00001] == Pi,
x'[0.00001] == -1.117876}}];
Plot[Evaluate[x[r] /. sols13], {r, 0.00001, 100},
AxesLabel -> {r, \[Theta][r]}, LabelStyle -> "Input",
PlotRange -> All]
ParametricPlot[{x[r] /. First@sols13, D[x[r] /. First@sols13, r]} //
Evaluate, {r, 0.00001, 100}, Frame -> True,
FrameLabel -> {\[Theta][r], \[Theta]'[r]}, LabelStyle -> "Input"]
I used a parametric plot to find the value of x'[0.0001] in order to get the desired plot.
r == 7
). If for some reason you need to integrate further, improve your guess forx'[0.00001]
. By the way, the larger
solution you obtained is valid, except that it does not match the boundary condition atr == 100
, as pointed out by the error messages you received. $\endgroup$