# n-body problem

{{#invoke:Hatnote|hatnote}} {{#invoke:Hatnote|hatnote}}

In physics, the n-body problem is an ancient, classical problem of predicting the individual motions of a group of celestial objects interacting with each other gravitationally. Solving this problem — from the time of the Greeks and on — has been motivated by the desire to understand the motions of the Sun, Moon, planets and the visible stars. In the 20th century, understanding the dynamics of globular cluster star systems became an important n-body problem. The n-body problem in general relativity is considerably more difficult to solve.

The classical physical problem can be informally stated as: given the quasi-steady orbital properties (instantaneous position, velocity and time) of a group of celestial bodies, predict their interactive forces; and consequently, predict their true orbital motions for all future times.

To this purpose the two-body problem has been completely solved and is discussed below; as is the famous Restricted 3-Body Problem.

## History

Knowing three orbital positions of a planet's orbit – positions obtained by Sir Isaac Newton (1643-1727) from astronomer John Flamsteed – Newton was able to produce an equation by straightforward analytical geometry, to predict a planet's motion; i.e., to give its orbital properties: position, orbital diameter, period and orbital velocity. Having done so he and others soon discovered over the course of a few years, those equations of motion did not predict some orbits very well or even correctly. Newton realized it was because gravitational interactive forces amongst all the planets was affecting all their orbits.

The above discovery goes right to the heart of the matter as to what exactly the n-body problem is physically: as Newton realized, it is not sufficient to just specify the initial position and velocity, or three orbital positions either, to determine a planet's true orbit: the gravitational interactive forces have to be known too. Thus came the awareness and rise of the n-body “problem” in the early 17th century. These gravitational attractive forces do conform to Newton's Laws of Motion and to his Law of Universal Gravitation, but the many multiple (n-body) interactions have historically made any exact solution intractable. Ironically, this conformity led to the wrong approach.

After Newton's time the n-body problem historically was not stated correctly because it did not include a reference to those gravitational interactive forces. Newton does not say it directly but implies in his Principia the n-body problem is unsolvable because of those gravitational interactive forces. Newton said in his Principia, paragraph 21:

And hence it is that the attractive force is found in both bodies. The Sun attracts Jupiter and the other planets, Jupiter attracts its satellites and similarly the satellites act on one another. And although the actions of each of a pair of planets on the other can be distinguished from each other and can be considered as two actions by which each attracts the other, yet inasmuch as they are between the same, two bodies they are not two but a simple operation between two termini. Two bodies can be drawn to each other by the contraction of rope between them. The cause of the action is twofold, namely the disposition of each of the two bodies; the action is likewise twofold, insofar as it is upon two bodies; but insofar as it is between two bodies it is single and one ...

Newton concluded via his 3rd Law that "according to this Law all bodies must attract each other." This last statement, which implies the existence of gravitational interactive forces, is key.

As shown below, the problem also conforms to Jean Le Rond D'Alembert's non-Newtonian 1st and 2nd Principles and to the nonlinear n-body problem algorithm, the latter allowing for a closed form solution for calculating those interactive forces.

The problem of finding the general solution of the n-body problem was considered very important and challenging. Indeed in the late 19th century King Oscar II of Sweden, advised by Gösta Mittag-Leffler, established a prize for anyone who could find the solution to the problem. The announcement was quite specific:

Given a system of arbitrarily many mass points that attract each according to Newton's law, under the assumption that no two points ever collide, try to find a representation of the coordinates of each point as a series in a variable that is some known function of time and for all of whose values the series converges uniformly.

In case the problem could not be solved, any other important contribution to classical mechanics would then be considered to be prize-worthy. The prize was awarded to Poincaré, even though he did not solve the original problem. (The first version of his contribution even contained a serious error). The version finally printed contained many important ideas which led to the development of chaos theory. The problem as stated originally was finally solved by Karl Fritiof Sundman for n = 3.

## General formulation

$\mathbf {F} _{ij}={\frac {Gm_{i}m_{j}(\mathbf {q} _{j}-\mathbf {q} _{i})}{\left\|\mathbf {q} _{j}-\mathbf {q} _{i}\right\|^{3}}},$ Summing over all masses yields the n-body equations of motion:

$m_{i}{\frac {d^{2}\mathbf {q} _{i}}{dt^{2}}}=\sum _{j=1,j\neq i}^{N}{\frac {Gm_{i}m_{j}(\mathbf {q} _{j}-\mathbf {q} _{i})}{\left\|\mathbf {q} _{j}-\mathbf {q} _{i}\right\|^{3}}}={\frac {\partial U}{\partial \mathbf {q} _{i}}}$ $U=\sum _{1\leq i ${\frac {d\mathbf {q} _{i}}{dt}}={\frac {\partial H}{\partial \mathbf {p} _{i}}}\qquad {\frac {d\mathbf {p} _{i}}{dt}}=-{\frac {\partial H}{\partial \mathbf {q} _{i}}},$ where the Hamiltonian function is

$H=T+U$ and T is the kinetic energy

$T=\sum _{i=1}^{N}{\frac {\left\|\mathbf {p} _{i}\right\|^{2}}{2m_{i}}}.$ Hamilton's equations show that the n-body problem is a system of $6N$ first-order differential equations, with 6N initial conditions as 3N initial position coordinates and $3N$ initial momentum values.

Symmetries in the n-body problem yield global integrals of motion that simplify the problem. Translational symmetry of the problem results in the center of mass

$\mathbf {C} ={\frac {\sum _{i=1}^{N}m_{i}\mathbf {q} _{i}}{\sum _{i=1}^{N}m_{i}}}$ moving with constant velocity, so that $\mathbf {C} =\mathbf {L} _{0}t+\mathbf {C} _{0}$ , where $\mathbf {L} _{0}$ is the linear momentum and C0 is the initial position. The constants of motion L0 and $\mathbf {C} _{0}$ represent six integrals of the motion. Rotational symmetry results in the total angular momentum being constant

$\mathbf {A} =\sum _{i=1}^{N}\mathbf {q} _{i}\times \mathbf {p} _{i},$ where $\times$ is the cross product. The three components of the total angular momentum $\mathbf {A}$ yield three more constants of the motion. The last general constant of the motion is given by the conservation of energy $H$ . Hence, every n-body problem has ten integrals of motion.

The moment of inertia of an n-body system is given by

$I=\sum _{i=1}^{N}m_{i}\mathbf {q} _{i}\cdot \mathbf {q} _{i}=\sum _{i=1}^{N}m_{i}\|\mathbf {q} _{i}\|^{2}$ and the virial is given by $Q=(1/2)dI/dt$ . Then the Lagrange-Jacobi formula states that

${\frac {d^{2}I}{dt^{2}}}=2T-U.$ For systems in dynamic equilibrium, the long-term time average of $\langle d^{2}I/dt^{2}\rangle$ is zero. Then on average the total kinetic energy is half the total potential energy, $\langle T\rangle =\langle U\rangle /2$ , which is an example of the virial theorem for gravitational systems. If M is the total mass and R a characteristic size of the system (for example, the radius containing half the mass of the system), then the critical time for a system to settle down to a dynamic equilibrium is $t_{\rm {cr}}={\sqrt {GM/R^{3}}}$ .

## Special cases

### Two-body problem

{{#invoke:main|main}} Any discussion of planetary interactive forces has always started historically with the Two-body problem. The purpose of this Section is to relate the real complexity in calculating any planetary forces. Note in this Section also, several subjects, such as gravity, barycenter, Kepler's Laws, etc.; and in the following Section too (Three-body problem) — are discussed on other Wikipedia pages. Here though, these subjects are discussed from the perspective of the n-body problem.

The two-body problem $(N=2)$ was completely solved by Johann Bernoulli (1667-1748) by classical theory (and not by Newton) by assuming the main point-mass was fixed, is outlined here. Consider then the motion of two bodies, say Sun-Earth, with the Sun fixed, then:

$m_{1}\mathbf {a} _{1}={\frac {Gm_{1}m_{2}}{r_{12}^{3}}}(\mathbf {r} _{2}-\mathbf {r} _{1})\quad {\text{Sun-Earth}}$ $m_{2}\mathbf {a} _{2}={\frac {Gm_{1}m_{2}}{r_{21}^{3}}}(\mathbf {r} _{1}-\mathbf {r} _{2})\quad {\text{Earth-Sun}}$ The equation describing the motion of mass $m_{2}$ relative to mass $m_{1}$ is readily obtained from the differences between these two equations and after canceling common terms gives: $\alpha +(\eta /r^{3})\mathbf {r} =0$ , where

The equation $\alpha +(\eta /r^{3})\mathbf {r} =0$ is the fundamental differential equation for the two-body problem Bernoulli solved in 1734. Notice for this approach forces have to be determined first, then the equation of motion resolved. This differential equation has elliptic, or parabolic or hyperbolic solutions, ,.

It is incorrect to think of $m_{1}$ (the Sun) as fixed in space when applying Newton's Law of Universal Gravitation, and to do so leads to erroneous results. The fixed point for two isolated gravitationally interacting bodies is their mutual barycenter, and this two-body problem can be solved exactly, such as using Jacobi coordinates relative to the barycenter.

Dr. Clarence Cleminshaw calculated the approximate position of the Solar System's barycenter, a result achieved mainly by combining only the masses of Jupiter and the Sun. Science Program stated in reference to his work:

"The Sun contains 98 per cent of the mass in the solar system, with the superior planets beyond Mars accounting for most of the rest. On the average, the center of the mass of the Sun-Jupiter system, when the two most massive objects are considered alone, lies 462,000 miles from the Sun's center, or some 30,000 miles above the solar surface! Other large planets also influence the center of mass of the solar system, however. In 1951, for example, the systems' center of mass was not far from the Sun's center because Jupiter was on the opposite side from Saturn, Uranus and Neptune. In the late 1950s, when all four of these planets were on the same side of the Sun, the system's center of mass was more than 330,000 miles from the solar surface, Dr. C. H. Cleminshaw of Griffith Observatory in Los Angeles has calculated."

The Sun wobbles as it rotates around the galactic center, dragging the Solar System and Earth along with it. What mathematician Kepler did in arriving at his three famous equations was curve-fit the apparent motions of the planets using Tycho Brahe's data, and not curve-fitting their true circular motions about the Sun (see Figure). Both Robert Hooke and Newton were well aware that Newton's Law of Universal Gravitation did not hold for the forces associated with elliptical orbits. In fact, Newton's Universal Law does not account for the orbit of Mercury, the asteroid belt's gravitational behavior, or Saturn's rings. Newton stated (in the 11th Section of the Principia) that the main reason, however, for failing to predict the forces for elliptical orbits was that his math model was for a body confined to a situation that hardly existed in the real world, namely, the motions of bodies attracted toward an unmoving center. Some present physics and astronomy textbooks don't emphasize the negative significance of Newton's assumption and end up teaching that his math model is in effect reality. It is to be understood that the classical two-body problem solution above is a mathematical idealization. See also Kepler's first law of planetary motion.

Some modern writers have criticized Newton's fixed Sun as emblematic of a school of reductive thought - see Truesdell's Essays in the History of Mechanics referenced below. An aside: Newtonian physics doesn't include (among other things) relative motion and may be the root of the reason Newton "fixed" the Sun.

### Three-body problem

{{#invoke:main|main}} This Section relates an historically important n-body problem solution after simplifying assumptions were made.

In the past not much was known about the n-body problem for n equal to or greater than three. The case for n = 3 has been the most studied. Many earlier attempts to understand the Three-body problem were quantitative, aiming at finding explicit solutions for special situations.

• In 1687 Isaac Newton published in the Principia the first steps in the study of the problem of the movements of three bodies subject to their mutual gravitational attractions, but his efforts resulted in verbal descriptions and geometrical sketches; see especially Book 1, Proposition 66 and its corollaries (Newton, 1687 and 1999 (transl.), see also Tisserand, 1894).
• In 1767 Euler found collinear motions, in which three bodies of any masses move proportionately along a fixed straight line. The circular restricted three-body problem is the special case in which two of the bodies are in circular orbits (approximated by the Sun-Earth-Moon system and many others).
• In 1772 Lagrange discovered two classes of periodic solution, each for three bodies of any masses. In one class, the bodies lie on a rotating straight line. In the other class, the bodies lie at the vertices of a rotating equilateral triangle. In either case, the paths of the bodies will be conic sections. Those solutions led to the study of central configurations , for which ${\ddot {q}}=kq$ for some constant k>0 .
• A major study of the Earth-Moon-Sun system was undertaken by Charles-Eugène Delaunay, who published two volumes on the topic, each of 900 pages in length, in 1860 and 1867. Among many other accomplishments, the work already hints at chaos, and clearly demonstrates the problem of so-called "small denominators" in perturbation theory.
• In 1917 Forest Ray Moulton published his now classic, An Introduction to Celestial Mechanics (see references) with its plot of the Restricted Three-body Problem solution (see figure below). An aside, see Meirovitch's book, pages 414 and 413 for his Restricted Three-body Problem solution.

Moulton's solution may be easier to visualize (and definitely easier to solve) if one considers the more massive body (e.g., Sun) to be "stationary" in space, and the less massive body (e.g., Jupiter) to orbit around it, with the equilibrium points (Lagrangian points) maintaining the 60 degree-spacing ahead of, and behind, the less massive body almost in its orbit (although in reality neither of the bodies are truly stationary, as they both orbit the center of mass of the whole system—about the barycenter). For sufficiently small mass ratio of the primaries, these triangular equilibrium points are stable, such that (nearly) massless particles will orbit about these points as they orbit around the larger primary (Sun). The five equilibrium points of the circular problem are known as the Lagrangian points. See figure below:

In the Restricted 3-Body Problem math model figure above (ref. Moulton), the Lagrangian points L4 and L5 are where the Trojan planetoids resided (see Lagrangian point); m1 is the Sun and m2 is Jupiter. L2 is where the asteroid belt is. It has to be realized for this model, this whole Sun-Jupiter diagram is rotating about its barycenter. The Restricted 3-Body Problem solution predicted the Trojan planetoids before they were first seen. The h-circles and closed loops echo the electromagnetic fluxes issued from the Sun and Jupiter. It is conjectured, contrary to Richard H. Batin conjecture (see References), the two h1's are gravity sinks, in and where gravitational forces are zero, and the reason the Trojan planetoids are trap there. The total amount of mass of the planetoids is unknown.

The Restricted Three-body Problem assumes the mass of one of the bodies is negligible.{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }} For a discussion of the case where the negligible body is a satellite of the body of lesser mass, see Hill sphere; for binary systems, see Roche lobe. Specific solutions to the Three-body problem result in chaotic motion with no obvious sign of a repetitious path.{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }}

In the physical literature about the $n$ -body problem ($n$ ≥ 3), sometimes reference is made to the impossibility of solving the $n$ -body problem (via employing the above approach).{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }} However, care must be taken when discussing the 'impossibility' of a solution, as this refers only to the method of first integrals (compare the theorems by Abel and Galois about the impossibility of solving algebraic equations of degree five or higher by means of formulas only involving roots). ### Power series solution One way of solving the classical n-body problem is "the n-body problem by Taylor series", which is an implementation of the Power series solution of differential equations. We start by defining the system of differential equations:{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }}

${\frac {d^{2}\mathbf {x} _{i}(t)}{dt^{2}}}=G\sum _{k=1,k\neq i}^{n}{\frac {m_{k}\left(\mathbf {x} _{k}(t)-\mathbf {x} _{i}(t)\right)}{\left|\mathbf {x} _{k}(t)-\mathbf {x} _{i}(t)\right|^{3}}}$ ,

As xi (t = t0) and dxi(t)/dtt=t0 are given as initial conditions, every d2xi(t)/dt2 are known. Differentiating d2xi(t)/dt2 results in d3xi(t)/dt3 which at t0 which is also known, and the Taylor series is constructed iteratively.Template:Clarify

### A generalized Sundman global solution

In order to generalize Sundman's result for the case n > 3 (or n = 3 and c = 0Template:Clarify) one has to face two obstacles:

1. As it has been shown by Siegel, collisions which involve more than two bodies cannot be regularized analytically, hence Sundman's regularization cannot be generalized.
2. The structure of singularities is more complicated in this case: other types of singularities may occur (see below).

Lastly, Sundman's result was generalized to the case of n > 3 bodies by Q. Wang in the 1990s. Since the structure of singularities is more complicated, Wang had to leave out completely the questions of singularities. The central point of his approach is to transform, in an appropriate manner, the equations to a new system, such that the interval of existence for the solutions of this new system is $[0,\infty )$ .

### Singularities of the n-body problem

There can be two types of singularities of the n-body problem:

• collisions of two or more bodies, but for which q(t) (the bodies' positions) remains finite. (In this mathematical sense, a "collision" means that two point-like bodies have identical positions in space.)
• singularities in which a collision does not occur, but q(t) does not remain finite. In this scenario, bodies diverge to infinity in a finite time, while at the same time tending towards zero separation (an imaginary collision occurs "at infinity").

The latter ones are called Painlevé's conjecture (no-collisions singularities). Their existence has been conjectured for n > 3 by Painlevé (see Painlevé conjecture). Examples of this behavior for n=5 have been constructed by Xia and a heuristic model for n=4 by Gerver. Donald G. Saari has shown that singularities have measure zero for many cases.

## Simulation

{{#invoke:main|main}}

While there are analytic solutions available for the two-body problem and for selected configurations with $N>2$ , in general n-body problems must be solved or simulated using numerical methods.

### Few bodies

For a small number of bodies, an n-body problem can be solved using direct methods, also called particle-particle methods. These methods numerically integrate the differential equations of motion. Numerical integration for this problem can be a challenge for several reasons. First, the gravitational potential is singular; it goes to infinity as the distance between two particles goes to zero. The gravitational potential may be softened to remove the singularity at small distances:

$U_{\epsilon }=\sum _{1\leq i Second, in general for N > 2, the N-body problem is chaotic, which means that even small errors in integration may grow exponentially in time. Third, a simulation may be over large stretches of model time (e.g., millions of years) and numerical errors accumulate as integration time increases.

There are a number of techniques to reduce errors in numerical integration. Local coordinate systems are used to deal with widely differing scales in some problems, for example an Earth-Moon coordinate system in the context of a solar system simulation. Variational methods and perturbation theory can yield approximate analytic trajectories upon which the numerical integration can be a correction. The use of a symplectic integrator ensures that the simulation obeys Hamilton's equations to a high degree of accuracy and in particular that energy is conserved.

### Many bodies

Direct methods using numerical integration require on the order of $N^{2}/2$ computations to evaluate the potential energy over all pairs of particles, and thus have a time complexity of $O(N^{2})$ . For simulations with many particles, the $O(N^{2})$ factor makes large-scale calculations especially time consuming.

A number of approximate methods have been developed that reduce the time complexity relative to direct methods:

### Strong gravitation

In astrophysical systems with strong gravitational fields, such as those near the event horizon of a black hole, n-body simulations must take into account general relativity; such simulations are the domain of numerical relativity. Numerically simulating the Einstein field equations is extremely challenging and a parameterized post-Newtonian formalism (PPN), such as the Einstein–Infeld–Hoffmann equations, is used if possible. The two-body problem in general relativity is analytically solvable only for the Kepler problem, in which one mass is assumed to be much larger than the other.

## Other n-body problems

Most work done on the n-body problem has been on the gravitational problem. But there exist other systems for which n-body mathematics and simulation techniques have proven useful.

In large scale electrostatics problems, such as the simulation of proteins and cellular assemblies in structural biology, the Coulomb potential has the same form as the gravitational potential, except that charges may be positive or negative, leading to repulsive as well as attractive forces. Fast Coulomb solvers are the electrostatic counterpart to fast multipole method simulators. These are often used with periodic boundary conditions on the region simulated and Ewald summation techniques are used to speed up computations.

In statistics and machine learning, some models have loss functions of a form similar to that of the gravitational potential: a sum of kernel functions over all pairs of objects, where the kernel function depends on the distance between the objects in parameter space. Example problems that fit into this form include all-nearest-neighbors in manifold learning, kernel density estimation, and kernel machines. Alternative optimizations to reduce the $O(N^{2})$ time complexity to $O(N)$ have been developed, such as dual tree algorithms, that have applicability to the gravitational n-body problem as well.