Message Boards Message Boards

Solve the reduced three-body problem?

Posted 6 years ago
Attachments:
POSTED BY: thomas rialan
8 Replies

I have no particular problems with this code:

u = 1/2;
r1[x_, y_, u_] := Sqrt[(x + 1 - u)^2 + y^2];
r2[x_, y_, u_] := Sqrt[(x - u)^2 + y^2];
Om[x_, y_, u_] := -1/2*u*r1[x, y, u]^2 - 1/2*(1 - u)*r2[x, y, u]^2 - 
   u/r1[x, y, u] - (1 - u)/r2[x, y, u];
{xsol, ysol} =
 NDSolveValue[{x''[t] - 2 y'[t] == -D[Om[x[t], y[t], u], x[t]],
   y''[t] + 2 x'[t] == -D[Om[x[t], y[t], u], y[t]],
   x[0] == y[0] == 0, x'[0] == y'[0] == 1/2},
  {x, y}, {t, 100}, PrecisionGoal -> 30]
ParametricPlot[{xsol[t], ysol[t]},
 {t, 0, 100}]
j[t_] := 1/2*xsol'[t]^2 + 1/2*ysol'[t]^2 +
   Om[xsol[t], ysol[t], u];
Plot[j[t], {t, 0, 100}]
POSTED BY: Gianluca Gorni
POSTED BY: Gianluca Gorni
Posted 6 years ago

Ok, thanks. This doesn't resolve the issue, unfortunately.

POSTED BY: thomas rialan

Try PrecisionGoal -> 30, or something like that, in DSolve.

POSTED BY: Gianluca Gorni
Posted 6 years ago

Thanks for the idea Gianluca. Surprisingly, this turns my plot of the motion into a straight line that that goes to huge negative values, order $10^7$. Do you know of anything else that might be missing? If I keep a high upper bound on $t$ I get the error message:

NDSolve::ndsz: At t == 33.82118505471137`, step size is effectively zero; singularity or stiff system suspected.

How do I deal with a singularity? By increasing the step size maybe?

POSTED BY: thomas rialan

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

POSTED BY: Moderation Team
Posted 6 years ago

Hope this is better.

POSTED BY: thomas rialan
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract