I'm trying to solve an ODE with boundary values:
NDSolve[{(1 + Derivative[1][θ][ρ]^2) (3 θ'[ρ] Tan[θ[ρ]] - 4 Tanh[ρ]) +
Tanh[ρ] Tan[θ[ρ]] θ''[ρ] == 0, θ[0] == 0.5, θ[2] == Pi/2}, θ, {ρ, 0, 2}]
and getting the following error
Infinity::indet: "Indeterminate expression 0.\ ComplexInfinity encountered."
For some boundary values it works, especially if the start and end points are close together. As the points are moved apart, it starts to fail. Any idea why it is failing?
." The fact that this happens at the initial condition and not somewhere in the interior of the interval of integration suggests a singularity atρ == 0. Indeed, the coefficient ofθ''[ρ]vanishes becauseTanh[0] == 0. SinceNDSolvebegins by solving forθ''[ρ], and the1/Tanh[ρ]turns intoCoth[ρ], this is the source of theComplexInfinity`. This has a similar problem. – Michael E2 Aug 25 '16 at 22:29NDSolve[{(1 + Derivative[ 1][\[Theta]][\[Rho]]^2) (3 \[Theta]'[\[Rho]] Tan[\[Theta][\ \[Rho]]] - 4 Tanh[\[Rho]]) + Tanh[\[Rho]] Tan[\[Theta][\[Rho]]] \[Theta]''[\[Rho]] == 0, \[Theta][0.1] == 0.5, \[Theta][2] == Pi/2 - 0.1}, \[Theta], {\[Rho], 0.1, 2}]– Damien Juan Aug 26 '16 at 20:080is one problem, but as you seemed to notice, starting at0.1leads to a different problem. – Michael E2 Aug 26 '16 at 21:46ρ == 0, the infinity is "your fault", because one gets the initial value forθ''[0]by dividing byTanh[0]; when you start atρ == 0.1, somewhere down the line the shooting method tries{θ[0.1], θ'[0.1]} == {0., 0.}as an initial condition which also leads to infinity forθ''[0]from the factorTan[θ[ρ]]in front of the second derivative. That's the fault ofNDSolve. I suppose it tries{0., 0.}because it cannot satisfy the BCs withθ[0.1] == 0.5. – Michael E2 Aug 27 '16 at 21:18