I am modeling the motion of a shell falling into a black hole in Kruskal coordinate with NDSolve. I am sure that the physics behind it is correct, but can't get the desired result i.e. a smooth function defined on {0, rWALL}.
The code:
V[r_] := 1 - 100/r + r^2 - (0.16 (100/r + 1.4375 r^2)^2)/r^2
mfo[r_] := 1 - 100/r + r^2
h = 4.56978
rWALL = 6.03647
k = 13.9282
w[r_] := 1/(2 (1 + 3 h^2) Sqrt[4 + 3 h^2]) ((4 + 6 h^2) ArcTan[(h + 2 r)/Sqrt[4 + 3 h^2]] + h Sqrt[4 + 3 h^2] (2 Log[Abs[-h + r]] - Log[Abs[1 + h^2 + h r + r^2]]))
Twall[r_] := Sqrt[Xwall[r]^2 - Exp[k*w[r]]]
SolX = NDSolve[{Sqrt[(4 fo[r])/(k^2 Exp[k*w[r]])] Sqrt[-V[r]]Sqrt[(Twall'[r]^2 - Xwall'[r]^2)] == 1, Xwall[rWALL] == 1.02227}, Xwall, {r, 0, rWALL} ]
I only got the following warnings:
NDSolve::ndsdtc: The time constraint of 1.` seconds was exceeded trying to solve for derivatives, so the system will be treated as a system of differential-algebraic equations. You can use Method->{"EquationSimplification"->"Solve"} to have the system solved as ordinary differential equations.
NDSolve::nlnum: "The function value {-1+(0. +0.00223649\ I)\ Sqrt[0. \-5.31229\Plus[<<2>>]^2]} is not a list of numbers with dimensions {1} \at \!\({r, Xwall[r], \*SuperscriptBox[\"Xwall\", \"\[Prime]\",MultilineFunction->None][r]}\) = {6.03647,1.02227,0.}."
NDSolve::icfail: unable to find initial conditions that satisfy the residual function within specified tolerances. Try giving initial conditions for both values and derivatives of the functions.
Can someone help me with it? Thanks.


NDSolveseems strange. Have you set some time constraints that you didn't show in your code, or perhaps globally? – MarcoB Aug 16 '17 at 03:23NDSolve::ntdv: Cannot solve to find an explicit formula for the derivatives. Consider using the option Method->{"EquationSimplification"->"Residual"}.I recommend that you seek ways to eliminate theSqrtandAbs, which probably are the source of your difficulties. – bbgodfrey Aug 16 '17 at 04:32Xwallalways real? – xzczd Aug 16 '17 at 05:17