Gravitational attraction of the sun and moon during cislunar-midcourse flight

indy91

Addon Developer
Addon Developer
Joined
Oct 26, 2011
Messages
1,264
Reaction score
727
Points
128
The Apollo Guidance Computer had a routine to numerically integrate the state vector, the Coasting Integration Routine. If the Apollo spacecraft was somewhere between the Earth and the Moon, the routine would not only take the gravitation of the Earth into account, but also the Moon and Sun.

But somewhere in the equations I get confused.

The basic equation is quite straighforward:

[MATH]\frac{d^2}{dt^2}\underline{r}(t)+\frac{\mu_p}{r^3} \underline{r}(t)=\underline{a}_d(t)[/MATH]

with mu_p being the standard gravitational parameter of the primary body (Earth or Moon, let's assume from now on it is the Earth) and a_d are the disturbing accelerations.

One of the disturbing accelerations is the gravitational influence of the sun.
I would have thought that equation has to be:

[MATH]\underline{a}_{dS}=-\frac{\mu_S}{r_{SC}^3}[-\underline{r}_{ES}+\underline{r}][/MATH]

a_dS = acceleration due to the Sun
mu_S=standard gravitational parameter of the Sun
r_ES = vector from the Earth to the Sun
r = position vector relative to the Earth
r_SC = vector from the sun to the vehicle (CSM), r_SC=r-r_ES

The equation in the guidance equations document is:

[MATH]\underline{a}_{dS}=-\frac{\mu_S}{r_{SC}^3}[f(q_S) \underline{r}_{PS}+\underline{r}][/MATH]

r_PS = vector from the primary body (Earth) to the sun


with

[MATH]q_S=\frac{(\underline{r}-2 \underline{r}_{PS}) \cdot \underline{r}}{r_{PS}^2}[/MATH]

and

[MATH]f(q)=q \frac{3+3q+q^2}{1+(1+q)^{3/2}}[/MATH]

The equations are very similar, but what I don't understand: why the function f as a factor? The results with it seem right and the factor makes the number for the acceleration of the sun quite small when the vehicle is close to the moon.

Does the Earth influence the gravity of the sun, if it is "in the way"? Or do I have a misconception about the geometry? It seems the answer isn't too difficult, but I am kind of clueless.

So any help would be appreciated! :thumbup:

EDIT: I changed r_SC to r_ES in equation no. 2
 
Last edited:
About 4-6 years ago I studied the AGC a bit. I don't recall all the details but the AGC is using Encke's method for the integration routine. Meaning that it will compute a numerical deviation from an analytic 2-body orbit.

The last equation (the factor f(q)) is some kind of crazy way to solve a difference of two very large and near equal values with limited precision.

I would recommend finding some information about Encke's method then the equations might start making some sense. (Except the last one)

The last equation appears at least in this document (page 9):
mse03_pertur_ocw.pdf

EDIT: That is also the method used in the IMFD Map program. LTMFD is using Cowell's method.
 
Last edited:
That was exactly the answer I hoped for! :cheers:

The document you linked refers to Richard Battin's book "An Introduction to the Mathematics and Methods of Astrodynamics", which I happen to have. And on the mentioned pages is the explanation for the f(q) part. I think I understand it now, it is exactly what you were saying, solving a difference of two very large and near equal values with limited precision.

For the AGC it was the best method to use for the numerical integration I guess. They had the solar and lunar ephemeris stored in the erasable memory and could just go from there.

You mentioned you are using Cowell's method in Lunar Transfer MFD. Can you use Orbiter's ephemeris or do you have to numerically integrate the movement of the bodies, too?
 
Actually, you aren't going to like me, but I'm going to take issue with the first of your equations (after having substituted in for the gravitational force exerted by the Sun on the ship):

[math]

\frac{d^2}{dt^2}\underline{r}(t)+\frac{\mu_p}{r^3} \underline{r}(t)=-\frac{\mu_S}{r_{SC}^3}[-\underline{r}_{ES}+\underline{r}]
[/math]

Notwithstanding your discussion on Encke's method, (and ignoring for a moment the Moon) this would all be fine if you were using an inertial reference frame in which to do your calculations. If one wanted to be picky, a natural choice for inertial reference frame would be one a non-rotating one centred on the Solar System barycentre (i.e., a point a few hundred thousand kilometres from the centre of the Sun).

If, however, you use geocentric coordinates, then the perturbing forces in your equation need to take into the fact that: a) the Earth is rotating around the Earth/Moon barycentre, and b) the barycentre of the Earth/Moon system is rotating around the Solar System barycentre. From the geocentric point of view, these motions give rise to a number of centrifugal, Coriolis and Euler forces that, in principle at least, you will want to take into account.

In a geocentric coordinate system, the most important of these 'fictitious' forces is the centrifugal acceleration due to the motion of the Earth in its orbit around the Sun. In this case, the perturbing force due to the Sun is the difference between the its Newtonian value (the 1/r^2 term) and the centrifugal force exerted on the Earth/Moon system as it orbits the Sun. And the difference between these forces is generally going to be quite small (because the Earth/Moon system is in a near circular orbit around the Sun).

Of course, if you are doing your calculations in an inertial reference frame, then you don't need to worry about any of this. Newtonian gravity is just Newtonian gravity.
 
Last edited:
The coordinate system I am using is the Basic Reference Coordinate System used in the AGC. It is a geocentric inertial coordinate system with the z-axis directed at the Earth's mean rotational axis. I guess that already assumes a lot about it being inertial (even if it is only for a 2 week moon landing mission).

What I actually learned, when reading about Encke's Method, was how the moving Earth is taken into account. The motion of a mass m2 (the Apollo spacecraft) relative to a mass m1 (Earth) within a system of n bodies is:

[MATH]\frac{d^2\boldsymbol{r}}{dt^2}+\frac{\mu}{r^3}\boldsymbol{r}=-G \sum\limits_{j=3}^n m_j (\frac{1}{d_j^3} \boldsymbol{d}_j+\frac{1}{\rho_j^3} \boldsymbol{\rho}_j )[/MATH]

with

[MATH]\boldsymbol{r}=\boldsymbol{r}_2-\boldsymbol{r}_1 \quad \boldsymbol{\rho}_j = \boldsymbol{r}_j-\boldsymbol{r}_1 \quad \boldsymbol{d}_j=\boldsymbol{r}-\boldsymbol{\rho}_j[/MATH]

Because the part in parenthesis leads to numerical troubles (I think!), it is written as

[MATH]\frac{1}{d^3}\boldsymbol{d}+\frac{1}{\rho^3}\boldsymbol{\rho}=\frac{1}{d^3}[\boldsymbol{r}+(\frac{d^3}{\rho^3}-1) \boldsymbol{\rho}] = \frac{1}{d^3}[\boldsymbol{r}+f(q) \boldsymbol{\rho}][/MATH]

which is part of the equation I posted above as the equation from the AGC guidance equations document.
 
Yes, those equations look correct to me.

Actually, I think you are using a non-inertial, geocentric, non-rotating reference frame - but a rose by any other name....

The term on the fight-hand side arises because the reference frame is non-inertial. These terms are essentially gravitational tidal forces relating to how quickly the gravitational field is changing in the vicinity of the Earth. These forces fall off roughy as r^-3, i.e., considerably faster than the normal Newtonian gravitational force (r^-2).

As we all know, in the neighbourhood of the Earth, tidal forces are primarily due to the Moon - but the Sun also contributes to a degree. In principle, there are also tidal forces from the other planets, but because of the r^-3 drop-off, one can safely ignore these contributions.
 
Last edited:
I guess a totally inertial system centered at a body is kind of impossible. The BRCS is defined in the Project Apollo Coordinate System Standards as the "Geocentric Inertial" coordinate system. In most case it is probably better to use the barycenter of the solar system as the reference system and then I can still convert the result back to the desired coordinate system.
 
This is why people spend a lot of time worrying about barycentres: the equations of motion take on a particular simple form when your reference frame is non-rotating and centred on the barycentre.

But there is a price to pay: if you do your calculations in the barycentric reference frame and then convert back later to your geocentric reference frame, you will be taking the difference of two numbers that are much the same size. If computer arithmetic were perfect this would not matter, but in normal floating point arithmetic this can cause a loss of precision. This, together with accumulated rounding error, can lead to problems.

And this is why people grit their teeth and work with geocentric reference frames instead. :)
 
Last edited:
You mentioned you are using Cowell's method in Lunar Transfer MFD. Can you use Orbiter's ephemeris

Yes, The LTMFD is using Orbiter's ephemeris.

..or do you have to numerically integrate the movement of the bodies, too?

No, and that wouldn't work, because the velocity given by the Orbiter for a planetary body is more or less an approximation and cant be used reliably for a numeric integration to predict a future positions.
 
Back
Top