A decision was made to let Carol take the controls, for now. Taking the keyboard in front of a large computer screen, she opens a new file nbody.C in her favorite editor. Expectantly, she looks at Alice, sitting to her left, for instructions, but Bob first raises a hand.
And yes, the 2-body problem can be solved analytically. That means
that you can write a mathematical formula for the solution. For
higher values of , whether 3 or 4 or more, no such closed formulas
are known, and we have no choice but to do numerical calculations in
order to determine the orbits. For
, we have the luxury of being
able to test the accuracy of our numerical calculations by comparing
our results with the formula that Newton discovered for the 2-body
problem.
Yet another reason to start with is that the description can be
simplified. Instead of giving the absolute positions and
velocities for each of the two particles, with respect to a given
coordinate system, it is enough to deal with the relative
positions and velocities. Instead of dealing with position
for the first particle and
for the second particle, we can
write down the gravitational attraction between the two in terms of
the relative position, defined as:
![]() |
(2.1) |
Newton's gravitational equation of motion then becomes:
![]() |
(2.2) |
This is a second-order differential equation. At the left-hand side
you see the second derivative of position with respect to time . The
first time derivative of position
is the velocity
while the second derivative presented here is the acceleration
. At the right hand side, the masses
of the two particles are indicated by
and
, respectively.
is the value of Newton's gravitational constant.
I'm glad you both have at least some familiarity with differential equations, in the context of classical mechanics. It may not be a bad idea to brush up your knowledge, if you want to know more about the background of Newtonian gravity. There are certainly plenty of good introductory books. At this point it is not necessary, though, to go deep into all that. I can just provide the few equations we need to get started, and for quite a while our main challenge will be to figure out how to solve these equations.
![]() |
(2.3) |
then the scalar distance between the two particles is defined by
![]() |
(2.4) |
And while it is true that Newtonian gravity is a force, we
have to tell the particles not only the magnitude of their mutual
attraction, but also the direction in which they pull each other.
This is accomplished by adding the last factor
. To compensate
for the fact that
grows linearly with the distance, we have to
add an extra power in the denominator.
![]() |
(2.5) |
![]() |
![]() |
![]() |
(2.6) |
![]() |
![]() |
![]() |
(2.7) |
Our original equation of motion now becomes simply: