How to mathematically describe a planet's eccentric orbit?

Is there a formula for describing a planet's position along an eccentric orbit over time? I am particularly interested in the elliptical case (0 < e < 1).

I understand that the planet has a higher velocity closer to the perihelion. Ideally I would like to be able to calculate a planet's position on it's orbital path in relation to how far through it's orbital period it is, if that makes sense.

Alternatively, is there software (that doesn't require a university's budget) to work this out?

The formula is Kepler's equation, but to understand it you need to know three values:

$M$ is the "Mean Anomaly". It increases linearly from 0 to 360 over the period of one orbit, measured from periapse to periapse. So if a planet has a period of 100 days, then the mean anomaly at day 0 is 0, at day 50 it 180degrees, at day 25 it is 90 degrees. This is only the position of the body that is in a circular orbit. It is the first stage of calculating the position of the body in an elliptical orbit.

$E$ is the "Eccentric Anomaly". This is also not the actual location of the planet. It is defined by $\cos\,E = x/a$ where $x$ is the x-coordinate of the of the planet, measured from the centre of the ellipse not the focus, and $a$ is the semi-major axis of the ellipse

$T$ is the "True anomaly", the angle between the actual position of the planet and the line through the major axis of the ellipse, measure at the focus of the ellipse (ie at the sun).

These are related by the Kepler equation. $$M = E- e\sin E,$$where $e$ is the eccentricity of the ellipse. You can calculate M directly, then solve this equation (numerically) to find E. Providing the eccentricty isn't very close to one, Newton's method is effective at finding a solution to this equation.

Then the true anomaly is given as $$T = 2 \, \mathop{\mathrm{arg}}\left(\sqrt{1-e} \, \cos\frac{E}{2} , \sqrt{1+e}\sin\frac{E}{2}\right)$$ (where $\mathrm{arg}(x,y)$ is available as atan2(y,x) in many programming languages)

It is possible to use the Eccentric anomaly to calculate the coordinates of the planet directly using $\cos\,E=x/a$and $\sin\,E=y/b$ where a and b are the semi-major and -minor axes of the ellipse.

The word "anomaly" doesn't mean "false result", but "angular deviation (from periapse)" and has been in use since Kepler's time.

• Kind of a bummer that $e$ is used, confusing us exponentialists. I can just see a series expansion with terms $e^e$ :-( – Carl Witthoft Feb 12 '18 at 14:22
• It may just be me, but Kepler's equation looks like weirdest thing in science, with E appearing both in a trig ratio and out of it. The dimensional analysis just looks all wrong. Formulas in science just don't look like that. Kepler thought so too. He spent a long time wondering if he had done something wrong, or if there was a way of solving this equation algebraically. – James K Feb 12 '18 at 16:07