Uni-Sine
Physics
+25XP
PhysicsFields and gravity

Gravity simulator

A gravity simulator shows how objects move under each other's gravitational pull. In our Orbit Simulator you launch up to six planets round a star and watch them follow Newton's law of gravitation: too slow and a planet falls in, at the right speed it circles, faster still it swings out on an ellipse, and beyond escape speed it leaves for good. It shows each body's speed, distance, period and eccentricity as it flies.

It opens on the four inner planets, Mercury, Venus, Earth and Mars, each launched at its real mean distance and speed from NASA's fact sheet, round a star of one solar mass.

Try it

Orbit Simulator

Launch planets and satellites and watch gravity shape their orbits

Go to its page

How to use the gravity simulator

  1. Under Scenes, pick a starting point: Inner planets, Outer planets, Bound or escape, Comet, or Planet and moon.
  2. Under Bodies, pick a body, or press Add a body (up to six). Set where it starts, in AU, and its speed along x and y, in km/s, or drag its launch arrow on the stage.
  3. Press Circular speed or Escape speed to set the exact speed for a circle or an escape from where the body is.
  4. Under Star and view, set the star's mass, from 0.1 to 20 Suns, and how far out to view. Turn on Bodies pull on each other to add their gravity on one another.
  5. Press play under Run. A dashed path shows where each body is heading, and the readouts give its speed, distance, the escape speed at that point, its orbit, period, eccentricity, and closest and farthest distances.

Distances are in astronomical units (1 AU is the Earth's mean distance from the Sun) and time in years. With bodies pulling on each other, each body's mass, in Earth masses, starts to matter, and the readout says the orbit is shaped by other bodies. Practice and help sets Kepler's third law, satellite speed and escape speed questions with worked solutions.

The physics behind the simulator

Every body is pulled towards the star by Newton's law of gravitation, F = GMm/r², so its acceleration is GM/r², whatever its own mass. From that one law come the speeds that decide an orbit:

SpeedFormulaAt 1 AU from the Sun
Circular orbitv = √(GM/r)29.8 km/s
Escapev = √(2GM/r)42.1 km/s

Escape speed is always √2, about 1.41, times the circular speed at the same distance. For a bound orbit, Kepler's third law links the period T to the semi-major axis a. In years and AU round a star of M solar masses, it becomes T² = a³/M. Our Kepler's third law guide and gravitational force calculator guide cover the formulas.

Worked examples you can check in the simulator

Example 1: the inner planets

In the opening scene, the readouts give periods close to the real ones:

PlanetDistanceLaunch speedPeriod in the simulator
Mercury0.387 AU47.4 km/s0.234 years
Venus0.723 AU35.0 km/s0.614 years
Earth1.00 AU29.8 km/s0.999 years
Mars1.52 AU24.1 km/s1.87 years

Check Mars with Kepler's third law: T = √(1.524³) = 1.88 years. Real orbits are slightly elliptical, but these launches start each planet at its mean distance and speed, so the orbits come out almost circular. The Outer planets scene does the same for Jupiter, Saturn, Uranus and Neptune, with periods of 11.9, 30.2, 84.2 and 164 years.

Example 2: bound or escape

The Bound or escape scene launches five bodies from 1 AU at different speeds, all sideways:

Launch speedOrbitEccentricityClosest and farthest
20 km/sEllipse, period 0.519 years0.5490.291 AU and 1 AU
29.8 km/sCircle, period 1 yearAbout 01 AU
38 km/sEllipse, period 4.40 years0.6281 AU and 4.37 AU
42.1 km/sJust bound, period about 10,000 years0.9981 AU and 927 AU
50 km/sEscapes on a hyperbola1.821 AU, then no limit

The 42.1 km/s body is a hair under the escape speed of 42.12 km/s, so it is still bound, on an ellipse reaching 927 AU. A sideways launch slower than circular speed puts the launch point at the far end of the ellipse; faster puts it at the near end.

Check the escape speed rule:

practice
Pick an answer, then check it.
A body moves in a circular orbit at 13 km/s. Roughly what speed would let it escape from the same distance?

Example 3: a heavier star

Set the star to 2 Suns, put a body at 1 AU and press Circular speed. It sets 42.1 km/s, √2 times faster than round the Sun, and the period is 0.707 years, because T² = a³/M = 1/2. A body at 4 AU round one Sun takes √(4³) = 8.00 years.

Example 4: a comet

The Comet scene launches a body from about 6 AU at 6.39 km/s. It falls in on a long ellipse with eccentricity 0.939, swings round the star at 0.214 AU, closer than Mercury, and goes back out to 6.86 AU every 6.65 years. It moves fastest at its closest point, as Kepler's second law says.

Solar system simulator: what it can and cannot show

Use the Inner planets and Outer planets scenes for a solar system simulator: each is set up from real distances and speeds. Because the simulator holds six bodies at most, the eight planets come in two scenes rather than one. Turn on Bodies pull on each other, and the Planet and moon scene shows a moon circling a heavy planet as both go round the star.

  • Flat, not 3D. Every orbit is in one plane.
  • The star stays still. It is fixed at the centre, so the star's own wobble is not shown.
  • No collisions between bodies. Bodies pass through each other; only the star can be hit.
  • No satellites round the Earth. The central body is a star of 0.1 to 20 solar masses, measured in AU and years. For a satellite's orbital speed, use v = √(GM/r) by hand, or the Circular Motion Calculator.

Common mistakes

  • Thinking a faster planet goes round more quickly. Launch faster from the same point and the orbit gets bigger, so the period gets longer.
  • Thinking mass changes the orbit. Round a fixed star, a planet's orbit does not depend on its own mass. Mass matters only when bodies pull on each other.
  • Using escape speed as "speed to leave the surface". Escape speed depends on where you start: from 1 AU it is 42.1 km/s, from Jupiter's distance, 5.2 AU, only 18.5 km/s.
  • Confusing the circle with an ellipse. Most real orbits are slightly elliptical, with eccentricity between 0 (a circle) and 1.

Practise gravity and orbits in a short timed paper

Orbits and gravity come up in High School Physics and College Physics (Calculus Based) practice, and in GCSE Physics Higher and A-level Physics: Year 2 in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. For escape speed from a planet's surface, use the Escape Velocity Calculator.

Common questions

What is a gravity simulator?
A program that moves objects according to their gravitational pull on each other. The Orbit Simulator uses Newton's law of gravitation to move up to six bodies round a star.
How fast does a planet need to go to orbit?
For a circular orbit, v = √(GM/r). At the Earth's distance from the Sun that is 29.8 km/s.
What is escape speed?
The speed that lets a body leave forever, √(2GM/r), which is √2 times the circular orbit speed at the same distance. From 1 AU round the Sun it is 42.1 km/s.
Why are orbits elliptical?
A body launched at anything other than exactly circular speed, below escape speed, moves on an ellipse with the star at one focus. This is Kepler's first law.
Can I simulate the whole solar system?
In two scenes: Inner planets and Outer planets. The simulator holds six bodies, so all eight planets do not fit at once.
Does the planet's mass affect its orbit?
Not round a fixed star: the acceleration GM/r² does not involve the planet's mass. Mass matters only when bodies pull on each other.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Orbit Simulator

    Launch planets and satellites and watch gravity shape their orbits

    Open the tool
  • Test it

    High School Physics

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
  • Test it

    College Physics (Calculus Based)

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Physics · Fields and gravityEscape velocity: formula, derivation and examplesThe escape velocity formula v = √(2GM/r), how to derive it, Earth's 11.2 km/s worked out, values for the planets, black holes and practice questions.