The following is a equation which describes various possible orbits of a particle around the Schwarzschild black hole spacetime in general relativity. I want to solve it from -Pi
to Pi
but fails, any suggestions?
d = 6 m; m = 2;
s =
NDSolve[
{u'[Ï•] - Sqrt[2 m u[Ï•]^3 - u[Ï•]^2 + 1/d^2] == 0, u[0] == 0},
u, {Ï•, -0.4, 2.5}]
P1 = PolarPlot[Evaluate[{1/(u[Ï•])} /. s], {Ï•, -0.4, 2.5},AspectRatio->1/GoldenRatio]
Answer
The equation can be solved with Method -> "StiffnessSwitching"
, together with a higher WorkingPrecision
:
d = 6 m; m = 2;
s = NDSolve[{u'[Ï•] - Sqrt[2 m u[Ï•]^3 - u[Ï•]^2 + 1/d^2] == 0, u[0] == 0},
u, {Ï•, -Pi, Pi}, Method -> "StiffnessSwitching", WorkingPrecision -> 64]
Plot[Evaluate[u[Ï•] /. s // Re], {Ï•, -Pi, Pi}]
Plot[Evaluate[1/u[Ï•] /. s // Re], {Ï•, -Pi, Pi}]
PolarPlot[Evaluate[1/u[Ï•] /. s // Re], {Ï•, -Pi, Pi}, Exclusions -> Ï• == 0,
PlotRange -> {{-30, 30}, Automatic}]
I added Re
because even with WorkingPrecision -> 64
the solution still involves very small imaginary numeric error e.g.
s[[1, 1, -1]][-Pi]
(* -0.0736592722609752787242287643805033631850830491206634648394182567 -
4.668866930386631320069097140978040*10^-31 I *)
Inspired by Solution 1, I found the problem can be resolved by adding a Re
in the equation:
d = 6 m; m = 2;
s = NDSolve[{u'[Ï•] - Re@Sqrt[2 m u[Ï•]^3 - u[Ï•]^2 + 1/d^2] == 0,
u[0] == 0}, u, {Ï•, -Pi, Pi}]
The resulting graph is the same as above so I'd like to omit it here.
I still have a feeling that the equation is wrong, at least incomplete, for example, don't you think the following
d = 6 m; m = 2;
s = NDSolve[{u'[Ï•]^2 == (Re@Sqrt[2 m u[Ï•]^3 - u[Ï•]^2 + 1/d^2])^2,
u[0] == 0}, u, {Ï•, -Pi, Pi}]
PolarPlot[Evaluate[1/u[Ï•] /. s], {Ï•, -Pi, Pi}, Exclusions -> Ï• == 0,
PlotRange -> {{-30, 30}, Automatic}]
seems to be more natural?
Comments
Post a Comment