7
votes

EDIT:

@auxsvr is correct that I had the force equations wrong, and about the -3/2 exponent.

Another way to see this it to simply to 2 dimensions and consider a force acting from the origin, proportional to 1/r^2 just like gravity, where r is the distance from the origin.

At (x,y), the force acts in the direction (-x,-y). However, that's just the direction, not the magnitude. If we use k as the constant of proportionality, the force is (-kx, -ky).

The magnitude of the force is thus Sqrt[(-kx)^2+(-ky)^2], or k*Sqrt[x^2+y^2], or k*Sqrt[r^2] or k*r

Since the force magnitude is also 1/r^2, this gives us k= 1/r^3.

The force is thus (-x/r^3, -y/r^3).

Since I was initially using r^2 as my primary quantity, that's (r^2)^(-3/2), which is where the 3/2 comes from.

This effectively invalidates my question, although it still makes an interesting theoretical discussion.

I retried this Mathematica with the correct equations, but still got no answer. As other points out, the result is only an ellipse under certain conditions (could be a parabola or hyperbola in other cases).

Additionally, although the eventual orbit is a conic section, the initial orbit may spiral in or out until the final conic section orbit is achieved.

EDIT ENDS HERE

I'm using Mathematica to solve the two-body problem:

DSolve[{
    d2[t] == (x1[t]-x0[t])^2 + (y1[t]-y0[t])^2 + (z1[t]-z0[t])^2,
    D[x0[t], t,t] == (x1[t]-x0[t])/d2[t],
    D[y0[t], t,t] == (y1[t]-y0[t])/d2[t],
    D[z0[t], t,t] == (z1[t]-z0[t])/d2[t],
    D[x1[t], t,t] == -(x1[t]-x0[t])/d2[t],
    D[y1[t], t,t] == -(y1[t]-y0[t])/d2[t],
    D[z1[t], t,t] == -(z1[t]-z0[t])/d2[t]
    },
    {x0,y0,z0,x1,y1,x1,d2},
    t
]

But I get back:

There are fewer dependent variables than equations, so the system is overdetermined.

I count 7 equations and 7 dependent variables?

In fact, the system is semi-undetermined, since I don't provide positions and velocities at time 0.

I realize my equations themselves might be wrong for the two-body problem, but I'd still like to know why Mathematica complains about this.

2
You have x1 listed as a variable twice and z1 not at all, hence the message. But fixing that will not suffice to get DSolve to give a result, it will only remove the error message. - Daniel Lichtblau
@belisarius, it would be fascinating to attempt to write such a function. It would be probably be very evil to write, though. fascinating, but evil. - rcollyer
@rcollyer You want DSolve to figure out to use polar? That's just cold... - Daniel Lichtblau
@rcollyer Just in case you are not aware of research.microsoft.com/apps/tools/tuva/index.HTML#data=3||| - Dr. belisarius
@Null did you just circumvent the word filter with Unicode? Devious. - Mr.Wizard

2 Answers

17
votes

How about NDSolve?

d2[t_] = (-x0[t] + x1[t])^2 + (-y0[t] + y1[t])^2 + (-z0[t] + 
    z1[t])^2; sol = {x0, y0, z0, x1, y1, z1} /. 
  NDSolve[{x0''[t] == (-x0[t] + x1[t])/d2[t], 
     y0''[t] == (-y0[t] + y1[t])/d2[t], 
     z0''[t] == (-z0[t] + z1[t])/d2[t], x1''[t] == -x0''[t], 
     y1''[t] == -y0''[t], z1''[t] == -z0''[t], x0[0] == 0, y0[0] == 0,
      z0[0] == 0, x1[0] == 1, y1[0] == 0, z1[0] == 0, x0'[0] == -0.5, 
     y0'[0] == 1, z0'[0] == 0.5, x1'[0] == 0.5, y1'[0] == -1, 
     z1'[0] == -0.5}, {x0, y0, z0, x1, y1, z1}, {t, 0, 120}][[1]]

r = 3;
 Animate[
  Graphics3D[
   {
    PointSize -> 0.05,
    Point[{sol[[1]][t], sol[[2]][t], sol[[3]][t]}],
    Point[{sol[[4]][t], sol[[5]][t], sol[[6]][t]}],
    Red,
    Line[Table[{sol[[1]][t1], sol[[2]][t1], sol[[3]][t1]}, {t1, 0, t, 0.1}]],
    Green,
    Line[Table[{sol[[4]][t1], sol[[5]][t1], sol[[6]][t1]}, {t1, 0, t, 0.1}]]
   }, 
   PlotRange -> {{-r, r}, {-r, r}, {-r, r}}
  ], {t, 0, 120}, AnimationRate -> 4
 ]

enter image description here

5
votes

I'm suprised no one else noticed that everyone wrote the equations of motion incorrectly, which is apparent from the plot, because bounded orbits in the gravitational potential of two bodies are always closed (Bertrand's theorem). The correct equations of motion are

{x0''[t] == (-x0[t] + x1[t])/d2[t]^(3/2), 
 y0''[t] == (-y0[t] + y1[t])/d2[t]^(3/2),
 x1''[t] == -x0''[t], 
 y1''[t] == -y0''[t]}

with

d2[t_]:= (x1[t]-x0[t])^2 + (y1[t]-y0[t])^2

since the motion is planar for central force fields. Also, one must set the initial conditions appropriately, otherwise the centre of mass moves and the orbits are no longer conical sections.