EDIT: Re-framed here to be more on-topic.

I am building a model of a simplified, fictional sun-planet-moon solar system (not the real Sun-Earth-Luna system) to calculate astronomical events like eclipses and lunar phases and the positions of the sun and moon in the sky of the planet at a given time, and want to know if there's anything I'm missing that would affect the accuracy of the model over the scale of several hundred years (that isn't being purposefully left out; see below). I want to be physically accurate within the restricted scope of the model.

In the model, all orbits are circular and in the same plane. At $t = 0$ the three bodies are colinear, with the moon located between the sun and the planet. The sun-planet-moon barycenter is located at the origin. The sun and the planet-moon barycenter both orbit the sun-planet-moon barycenter in 360 days; the planet and the moon both orbit the planet-moon barycenter in $\frac{360}{13}$ (≈27.69) days, with one synodic month (time between full/new moons) being exactly 30 days. The following diagram (very much NOT to scale) illustrates these motions:

View of the solar system model from the north pole looking down

  • The center of the sun has coordinates (-SunBarycenterDistance cos($t$), -SunBarycenterDistance sin($t$))
  • The center of the planet has coordinates (PlanetOrbitRadius cos($t$) + PlanetBarycenterDistance cos(13$t$), PlanetOrbitRadius sin($t$) + PlanetBarycenterDistance sin(13$t$))
  • The center of the moon has coordinates (PlanetOrbitRadius cos($t$) - MoonOrbitRadius cos(13$t$), PlanetOrbitRadius sin($t$) - MoonOrbitRadius sin(13$t$))


  • SunBarycenterDistance is the distance between the sun-planet-moon barycenter and the center of the sun, calculated based on the masses of the sun and the planet-plus-moon subsystem: (PlanetBarycenterDistance * (MassPlanet + MassMoon)) / (MassSun + MassPlanet + MassMoon)
  • PlanetOrbitRadius is the distance between the planet-moon barycenter and the sun-planet-moon barycenter, calculated based on the mass of the sun and the orbital period of the planet: cbrt((TimePlanetOrbit² * G * MassSun) / (4π²))
  • PlanetBarycenterDistance is the distance between the planet-moon barycenter and the center of the planet: (MoonOrbitRadius * MassMoon) / (MassPlanetPlusMoon)
  • MoonOrbitRadius is the distance between the planet-moon barycenter and the center of the moon: cbrt((TimeMoonOrbit² * G * MassPlanet) / (4π²))
  • G is the gravitational constant

Things I am purposefully leaving out:

  • non-circular orbits causing changes in orbital velocity at different points in the orbit; as mentioned above, the model's orbits are circular
  • apsidal precession; because the orbits are circular, there are no apsides
  • nodal precession; because the orbits are in the same plane, there are no orbital nodes
  • precession of the equinoxes and the difference between sidereal and solar years caused by general relativity and the oblateness of the sun and planet; I'm still working out how to calculate this and want to include it in the future, but I'm leaving it out for now
  • perturbations from other bodies; the model only considers the one sun, one planet, and one moon, with no other masses acting on these three bodies

Aside from these effects that I am purposefully leaving out of the model, are there any effects or motions that should be considered?

  • 4
    $\begingroup$ Without knowing the purpose of your model, it's hard to say what's missing. And if you force orbits to be circular (especially the moon's) you are probably not conforming to Newtonian gravity. $\endgroup$
    – Dr Chuck
    Commented Aug 1, 2021 at 19:14
  • $\begingroup$ @DrChuck my understanding is that Newtonian gravity supports circular orbits, as a special case of the common elliptical orbit. Is that not true? $\endgroup$
    – Lawton
    Commented Aug 1, 2021 at 19:20
  • $\begingroup$ yes, in a 2 body system, but otherwise, I don't think so. Happy to be shown wrong. $\endgroup$
    – Dr Chuck
    Commented Aug 1, 2021 at 19:23
  • $\begingroup$ @DrChuck How non-circular would the moon's orbit be, in this restricted three-body system? $\endgroup$
    – Lawton
    Commented Aug 1, 2021 at 19:32
  • $\begingroup$ @Lawton The difference between the Moon’s apogee and perigee is about one tenth of the average radius of the Moon’s orbit. $\endgroup$
    – gandalf61
    Commented Aug 1, 2021 at 19:56

4 Answers 4


I concur with the qualification that you have recreated in software a tellurion

To put your creation in perspective: the Antikythera device offered a representation of the motion of the Moon that is superior to what you created in software.

With a mechanical model the planets move like the hands of a clock; they move mechanically. What that means is that in effect you are not even modeling gravity.

(It is inevitable of course that in your model the Moon-Earth distance is not to scale with the Sun-Earth distance; every mechanical model has to deal with the distances of the solar system in one way or another.)

The animated GIF is about 1.5 MB, and you have bought very little for that.

You did take care to make it a looping animated GIF: when the 240 frames are completed the loop closes seamlessly.

Of course, in order to make the animation loop seamlessly you had to take liberty with the duration of the Moon orbit.

My recommendation:
Look up how the Antikythera mechanism gave the Moon a non-uniform angular velocity and incorporate that in the motion that goes into creating the frames of the animated GIF.

You mention the possibility of including relativistic effects at some future point. But the liberties you are already taking are far, far, far greater than any relativistic effect.

I'm assuming the intented usage is publication in the form of an animated GIF. I'm assuming that is your constraint.

(Without that constraint you would not be making an animation, but a simulation, with the motions of the celestial bodies being calculated in real time.)

Within the constraint of creating an animated GIF the best you can do is to include the non-uniform angular velocity of the Moon. Anything more is beyond an animated GIF anyway.

  • $\begingroup$ The GIF was just to show the motions, it isn't the final product. Given the scales involved, a true-to-scale image would be unworkable. I want a simulation of a simplified orbital system given the constraints I listed, not a simulation of our real system. Does that make sense? $\endgroup$
    – Lawton
    Commented Aug 1, 2021 at 20:35
  • $\begingroup$ @Lawton I gather the constraint is that it must be an animation, and not a simulation. The recommendation is the same either way: display the non-uniform angular velocity of the Moon with respect to the Earth. Other than that: in my own simulations I set up two panels, side by side. The left side panel presents a global view. The right side panel presents a zoomed in view, co-moving with the center of mass of the thing that it is zoomed in on. To not take advantage of the almost infinite possibilities of computer generated animation would be a gross omission. $\endgroup$
    – Cleonis
    Commented Aug 1, 2021 at 20:50
  • $\begingroup$ That is basically what I'm going to be doing, using zoomed-in views that track the various points of interest. How do I calculate the non-uniform angular velocity of the moon? $\endgroup$
    – Lawton
    Commented Aug 1, 2021 at 21:01
  • 1
    $\begingroup$ @Lawton Lunar theory is complicated. ;) See en.wikipedia.org/wiki/Lunar_theory The main perturbations even have their own names. You could use some of them in your simplified model. $\endgroup$
    – PM 2Ring
    Commented Aug 1, 2021 at 21:15
  • 1
    $\begingroup$ OTOH, rather than trying to perturb an orbit of the form $$x=r\cos(t/T), y=r\sin(t/T)$$ I recommend that you simulate the motions in your system by integrating the equations of motion based on $$F=Gm_1m_2/r^2$$ You can do that using, eg, Leapfrog or Verlet integration. $\endgroup$
    – PM 2Ring
    Commented Aug 1, 2021 at 21:16

There are aspects of the solar system that are not well approximated by this model. For example in the actual sole system the moon never goes backwards in its orbit around the sun.

  • 1
    $\begingroup$ The backwards movement you refer to is an artifact of the not-to-scale nature of the GIF. In true scale the moon does not go backwards at any point, but the three bodies would be too small to see in a view that shows the full width of Earth's orbit. $\endgroup$
    – Lawton
    Commented Aug 1, 2021 at 19:17

You have created a very simple digital orrery - in fact, since it only includes the Sun, the Moon and the Earth it is technically a tellurion. Since you have intentionally omitted or approximated so many aspects of the actual motion, including scales and time periods, it is impossible to tell if you have accidentally omitted anything.


The orbit of the Moon could not be circular. As the Moon moved toward the Sun, in its orbit around Earth, it would accelerate towards the Sun. Then as it moved around Earth and started moving away from the Sun it would be slowed, this would result in an elliptical lunar orbit giving Earth a non-circular wobble around around the Earth - Moon barycenter.


Not the answer you're looking for? Browse other questions tagged or ask your own question.