Converting Apollo State Vectors To Orbits

Apollo 11's departure orbit relative to Van Allen Belts (2)
Click to enlarge
Prepared using Celestia

OK, another mathematical one. This is the fourth in a series of posts about the orbits followed by the Apollo spacecraft as they travelled to and from the moon—something I suppose is getting a little more topical now that NASA has finally got underway with its planned return to the lunar surface.

I started with a post entitled “Keplerian Orbital Elements”, which introduced the various parameters used to describe an orbit—these are the numbers you need to plug into a piece of orbit-plotting software, like Celestia, so that it will display the spacecraft’s trajectory for you. (It’s what I used to prepare the diagram at the head of this post.)

Then I progressed to “Finding Apollo Trajectory Data”, in which I provided links to the original Apollo documentation, and described how to pull the necessary data from those sources.

Then I digressed into “The Advent Of Atomic Time”, as a way of introducing the difference between the GMT times listed in the Apollo trajectory documents, and the Terrestrial Time (TT) we need to use in order to correctly describe the Apollo orbits.

In the first post I established that we need to know the following six orbital elements:

  • semimajor axis (a)
  • eccentricity (e)
  • inclination (i)
  • longitude of the ascending node (Ω)
  • argument of the periapsis (ω)
  • true anomaly (θ)

The first two give the orbit’s size and shape, the next three its orientation in three dimensions, and the last one tells us the spacecraft’s position in orbit—see my first post for more detail.

To go along with the true anomaly we need the time, called the epoch (t), at which our spacecraft is in that position. This is usually expressed in the form of a Julian Day, and there are online calculators that will convert a date and Greenwich Mean Time to a Julian Day—there’s one here.

And we need an orbital period (P). We can calculate this from the semimajor axis, if we know the mass (M) of the central body around which the orbiting spacecraft moves—in this case, the Earth. There’s a conversion factor, too, called the Universal Gravitational Constant (G), but since orbital calculations always involve multiplying M by G, and since M is constant for any given planet, the two can be lumped together into something called the Standard Gravitational Parameter (μ) for that planet. Currently accepted values for μ for the various planets are listed by the Jet Propulsion Laboratory.

In my second post I established that what we have available for Apollo are primarily state vectors—three-dimensional locations and velocities for given times. Here, for instance, is the Apollo 11 state vector for the time of Translunar Injection (TLI), which established the initial orbit on which the Apollo spacecraft departed from Earth.

TLI state vector for Apollo 11
Click to enlarge (Source: Apollo/Saturn V Postflight Trajectory AS-506)

I’ve marked the relevant data columns in red, and we have enough information here to produce all the required orbital elements and an epoch. We have, from left to right:

  • ground elapsed time (GET)
  • geocentric distance (r)
  • longitude (λ)
  • geocentric latitude (ψ)
  • heading (h)
  • flight-path angle (f)
  • space-fixed velocity (v)

I explained all these in my second post, and I’ll refer you back to that for more detail. GET measures the elapsed time since launch, and by adding that to the Julian Day calculated for the launch date and time, we get our epoch (t) for TLI—I walked through that process step by step in my second post. The next three parameters describe the spacecraft’s position in three-dimensional space, but relative to the rotating surface of the Earth, so there’s a little bit of work to do to convert these coordinates to the fixed celestial coordinate system we need for our orbit. And the next three numbers give the spacecraft’s velocity, again in three dimensions, and NASA have helpfully done the calculation to make this “space-fixed”—that is, they’ve taken the spacecraft’s velocity relative to the surface of the Earth (given in the “EF VEL” column), and added in the rotation speed of the Earth at that latitude, so that the quoted velocity is now relative to the fixed stars, rather than the rotating Earth.

In my second post, I worked out the epoch (in Julian Days) of Apollo 11’s Translunar Injection:

tUTC = 2440419.18209525 days

But, as I explained in my third post, this time is in Coordinated Universal Time (UTC), and to that figure we need to add the difference between UTC and TT on 16 July 1969, the date of the Apollo 11 Translunar Injection. In that previous post, I established that this difference, symbolized ΔT, was 39.746 seconds, and I’ll refer you back to that post for a description of the relevance and origin of that number.

So the Terrestrial Time epoch for our Apollo 11 orbit is:

tTT = tUTC +ΔT

tTT = 2440419.18255527 days

Now I need to convert the latitude and longitude coordinates to the equatorial coordinate system used in astronomy. The equivalent of latitude in this system is called declination (δ), and longitude translates into right ascension (α). The good news is that declination is equal to the geocentric latitude, so we can just set δ equal to ψ:

δ = 9.9204°

The conversion between λ and α is complicated by the Earth’s rotation. The zero meridian of longitude (the Greenwich meridian) only points at the zero meridian of right ascension (the vernal equinox) once per rotation. So to work out the right ascension corresponding to the longitude of TLI, we need to know in which direction the Greenwich meridian was pointing at time t, and this is a little complicated by the fact that the Earth doesn’t rotate at a constant rate. The angle between the vernal equinox and the Greenwich meridian is given by a quantity called Greenwich Mean Sidereal Time (GMST), which I introduced in my third post. Although this is commonly expressed in hours, minutes and seconds, it can be converted to an angular measurement in degrees, which is what we need. To find GMST we ideally need to know Universal Time in the form of UT1, which is approximated by the civil time, UTC. It was actually quite well approximated by UTC during the time of the earlier Apollo missions, and I looked up the difference between the two times on 16 July 1969 in my third post:

ΔUT1 = 0.0115 seconds

So to calculate GMST properly we need another version of the epoch:

tUT1 = tUTC + ΔUT1

tUT1 = 2440419.18209538 days

You’ll find all sorts of equations to convert between UT1 and GMST. The one I use below comes from Chapter 2 of a Jet Propulsion Laboratory publication entitled Explanatory Supplement to Metric Prediction Generation—see equation 2-15, but the whole chapter is a nice primer on the complexities of astronomical time measurements.

First we need to express our UT1 epoch in terms of Julian Days elapsed since midday on 1 January 2000:

d = tUT12451545 days

Then we plug this value d into a rather large equation it’s difficult to cram on to one line:

\tiny GMST = 280.460618375 + 360.9856473663\cdot d + 2.9079\times 10^{-13}\cdot d^{2}-5.3\times 10^{-22}\cdot d^{3}

This usually generates a big number, reflecting the many rotations that have taken place between 1 January 2000 and the epoch of interest, so we need to narrow it down to a value between 0 and 360 degrees by adding or subtracting whole multiples of 360. Most spreadsheets and programming languages let you do this using the modulo function, which gives the remainder after division. So mod(GMST,360), or something similar, will give the remainder after GMST is divided by 360, which is what we need.*

When I run the TLI epoch through this process, I get an answer of -180.1181 degrees—negative, because 1969 comes before the year 2000. This is the equivalent of 179.8819 degrees, so at the epoch of TLI, the Greenwich meridian was pointing towards a right ascension of 179.8819 degrees.

Our longitude (λ) from the NASA table is -164.8373, and the right ascension is just λ+GMST, giving us, at long last:

α = 15.0446°

So that’s the fiddly bit done, and we now have our state vector in the necessary space-fixed coordinates.

Many reference sources deal with the conversion from state vector to orbital parameters. Ulrich Walter’s magisterial Astronautics: The Physics of Space Flight is a great resource, but uses vector notation I’m going to avoid here. A useful on-line resource is Uger Guven’s slide collection, Satellite Orbit Dynamics.

For a given state vector, three of the orbital parameters depend on the planetary mass. To see why this is so, consider a spacecraft with exactly the same position and velocity as Apollo 11’s at TLI, but orbiting a planet with half the mass—it will go farther from the planet before falling back again under the influence of gravity. So it’s useful to define a constant, C, which I’ll call the “energy constant”, because it’s a measure of the ratio between the spacecraft’s gravitational potential energy and its kinetic energy:

C = \frac{r\cdot v^{2}}{\mu }

From the NASA data table, r=6711.964km, and v=10.8343km/s at TLI. But what about μ? My JPL link from earlier in this post gives a value of 398600.435507km3/s2. (In the Apollo era NASA used an estimate that was a little different, but only after about the sixth significant figure.)

So for Apollo 11’s TLI:

C = 1.9766

We can now calculate orbital parameters a, e and θ. The semimajor axis depends only on C:

a=\frac{r}{2-C}

a = 286545 km

The eccentricity and true anomaly also depend on the flight-path angle (f):

e=\sqrt{\left ( C-1 \right )^{2}\cdot cos^{2}\left ( f \right )+sin^{2}\left ( f \right )}

e = 0.976966

\theta =atan\left ( \frac{C\cdot cos\left ( f \right )\cdot sin\left ( f \right )}{C\cdot cos^{2}\left ( f \right )-1} \right )

θ = 14.909º

The other parameters merely require a bit of spherical trigonometry:

i=acos\left ( cos\left ( \delta  \right )\cdot sin\left ( h \right ) \right )

i = 31.383º

Then we need a couple of intermediate calculations before we can derive our final two orbital parameters:

\varphi =asin\left ( \frac{sin\left ( \delta  \right )}{sin\left ( i \right )} \right )

To get this value into the correct quadrant before proceeding, we need to check the heading angle h. This is always between 0 and 180º for eastward launches (that is, pretty much every spacecraft launch). If it’s less than 90º we let φ stand, but if it’s over 90º, we set φ=(180º-φ). Then:

\omega =\varphi-\theta

ω = 4.410º

And:

\eta =acos\left ( \frac{cos\left ( \varphi  \right )}{cos\left ( \delta \right )} \right )

The longitude of the ascending node (Ω) depends on η, but also on which hemisphere we’re in, so we need to check δ before the final calculation. If δ<0º (ie, the southern hemisphere) then:

\Omega =\alpha +\eta 

Otherwise:

\Omega =\alpha -\eta 

Ω = 358.383º

And those are all our orbital parameters. Finally, we need an orbital period, which is:

P=\sqrt{\frac{4\cdot \pi ^{2}\cdot a^{3}}{\mu }}

P = 17.6679 days

Bringing it all together, we have a complete description of the orbit followed by Apollo 11 on its departure from Earth:

t = 2440419.18255527 days
a = 286545 km
e = 0.976966
i = 31.383º
Ω = 358.383º
ω = 4.410º
θ = 14.909º
P = 17.6679 days

In my second post I described how to extract a state vector from the Apollo data for re-entry, and we can plug those data into the same sequence of equations used above, to derive the elements of Apollo’s return orbit.

I could stop here, and you’re very welcome to stop at this point if you’ve managed to get this far. What follows is a description of how I went about checking that my calculations above produced valid results, and then a short Appendix that deals with calculating some alternative orbital parameters that you may need to know: the mean anomaly (M) and the time of pericentre passage (T).


We can get a quick sanity check on the calculations by looking at the summary “Translunar Injection Conditions” table from the Apollo 11 postflight trajectory document:

Apollo 11 Translunar Injection conditions
Click to enlarge (Source: Apollo/Saturn V Postflight Trajectory AS-506)

The orbital inclination figure from my calculation matches NASA’s exactly; the eccentricity goes astray in the sixth decimal place, presumably because of the difference between the 1960s estimate of μ and the present-day value. But if we add 180º to the descending node in NASA’s table we get an ascending node of 301.847º, which is a long way from my calculated value. But the reason for this is straightforward—NASA didn’t measure the position of the node in the conventional astronomical coordinates I’ve used to produce these orbital elements. Instead, they used a coordinate system defined by the onboard inertial navigation system housed in the Instrument Unit of the Saturn V launch vehicle. This system was kept constantly updated from the ground until just before launch, and the moment at which the inertial navigation system “locked in” its own set of coordinates (called Guidance Reference Release) was marked by a phrase many of us can remember from the Apollo launch sequence: “Guidance is internal!” This happened at time marker “T minus 17”—that is, 17 seconds before launch, and that marked the zero point for longitude, as far as Apollo was concerned.

The Julian Day corresponding to Guidance Reference Release for Apollo 11 is 2440419.06369213 UTC. If we use that to calculate GMST (remembering to go through UT1), we find that the Greenwich meridian was pointing towards a right ascension of 137.140º at that time. The launch pad for Apollo 11 (Complex 39 Pad A) is at longitude -80.604133º, and so at that instant had a right ascension of 56.536º (this is called the launch pad’s Local Mean Sidereal Time). That’s the point from which NASA measured its descending node for Apollo 11, and we need to add that angle to NASA’s nodes to convert to standard right ascension. I’ve already calculated that the ascending node in NASA’s coordinates is at 301.847º, which implies a right ascension of 56.536º+301.847º=358.383º. Which (ta-da!) is exactly the figure I calculated earlier.

These orbital elements are going to be pretty accurate for the first couple of hours of the translunar trajectory, during which the Apollo astronauts performed the Transposition, Docking, and Extraction manoeuvre, linking up with the Lunar Module and removing it from its cradle in the S-IVB stage. Shortly after that, they fired their engine for three seconds to kick themselves clear of the spent stage, acquiring an additional velocity of six metres per second—a pretty slight modification to the very high velocity at which they were leaving Earth behind. A day later, they fired the engine for another three-second burn in a midcourse correction manoeuvre—finely tweaking their trajectory to achieve a very accurate arrival in lunar orbit. And the orbit is going to be increasingly inaccurate as Apollo approaches the moon, when the moon’s gravity will progressively shift the trajectory away from the original ellipse defined by the TLI state vector.

But we can make another check on the accuracy of these orbital parameters, by checking if they at least deliver Apollo 11 to the vicinity of the moon at the time we know it entered lunar orbit—called Lunar Orbit Insertion (LOI), this happened at 17:21:50 GMT on 19 July 1969. Here’s what happens when I plug the calculated elements into Celestia, and set the time to LOI:

Apollo 11 orbit defined by TLI, extrapolated to the moon at time of Lunar Orbit Insertion - no midcourse corrections, no lunar gravity
Click to enlarge

Without any midcourse corrections, or any effect from lunar gravity, my simulated Apollo 11 shoots straight past the leading edge of the moon and is a short distance beyond it at the time of LOI. In reality, the moon’s gravity bent the trajectory around the back of the moon, where Apollo 11 fired its engine to slow down and enter lunar orbit. But this close rendezvous in simulation is a pretty good test that I’ve got all my orbital elements correct.

With all that in place, next time I come back to this topic I’ll write a bit more about Apollo 11’s first few hours on its departure orbit, and last few hours on its return orbit.


Appendix: For completeness, I should mention that there are other commonly used measures that define a spacecraft’s position in orbit at a precise instant—that is, alternatives to the true anomaly and epoch I derived above. The first of these is the mean anomaly (M) at epoch t. This is an angle calculated on the assumption the spacecraft moves around its orbit at constant angular speed, rather than accelerating and decelerating as it moves closer to and farther from the Earth. We get to M through an intermediary calculation of something called the eccentric anomaly (E).

E=acos\left ( \frac{1}{e}-\frac{r}{a\cdot e} \right )
M=E-e\cdot sin\left ( E \right )

For the Apollo 11 TLI state vector, this gives us:

M = 0.0375º

This is specific to the epoch t in the same way as the true anomaly.

Another parameter that’s often used is the time of pericentre passage (T). This abandons the epoch to which the state vector applies, and asks what the epoch would have been at the time the spacecraft made its closest approach to the body around which it orbits. And it doesn’t matter whether that close approach ever actually happened—there’s a close approach implicit in the maths of every elliptical orbit.

To come up with this number, we first convert M to a value measured in revolutions (divide the value for M given in degrees above by 360º) and then multiply be the period (P) in days. This tells us how many days ago the spacecraft would have passed through its closest approach. Then we subtract that number from the epoch (t) of the state vector, and we have the epoch (T) of the pericentre passage. In this case:

TTT = 2440419.18071554 days

And in this situation we don’t need to quote any sort of anomaly, because the anomaly at time T is (by definition) zero.


* Be slightly wary of online GMST calculators—many of them calculate GMST for noon on the Julian Day given, rather than for a specific time on that date.
This way of defining the longitude of the nodes, based on the Local Mean Sidereal Time of the launch site at Guidance Reference Release, applies for Apollo missions 10 to 17. The descending nodes quoted for Apollo missions 8 and 9 are based on Greenwich Mean Sidereal Time at Guidance Release. The mission reports for earlier flights give no descending node data.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.