N-Body Problem in 2D

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration shows a two-dimensional version of the -body problem, in which different masses interact gravitationally. In order to predict their motions, a system of coupled differential equations must be solved consistent with a set of initial conditions for positions and velocities that are chosen at random.

Contributed by: Enrique Zeleny (February 2013)
Open content licensed under CC BY-NC-SA



The equations of motion are:


where is the acceleration of the body , is the gravitational constant, is the mass, and is the vector connecting masses and .


[1] M. Trenti and P. Hut, "N-Body Simulations (Gravitational)," Scholarpedia, 3(5):3930, 2008. www.scholarpedia.org/article/N-body_simulations _ %28 gravitational %29.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.