Mars Orbit Calculation: Klaas Hartmann November 4, 2002

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Mars Orbit Calculation

Klaas Hartmann

November 4, 2002

Contents

1 Introduction 2

2 Position in Orbital Plane 2

3 Co-Ordinate Systems 3

4 Geocentric Transformation 4

5 Results 5

6 Conclusion 7

A Planet Data 8

B Calculation of Position in Orbital Plane 10

C Transformation to J2000/DE200 11

D Transformation to Geocentric Orbit 12

1
1 Introduction

The basic mechanics governing the orbits of our solar system were a mystery that puzzled
humankind for millennia. It is remarkable how much more complicated the problem
becomes when the system can only be observed from the inside.
The development of a mechanical model of our solar system and the subsequent ability
to predict the positions of celestial bodies has been crucial in many areas. One of the
first practical applications of this was in celestial navigation which was the primary form
of navigation well into the late 20th century. When humans started exploring space it
became crucial to have a thorough understanding of the mechanics involved, the ability
to predict future positions and have standard co-ordinate systems.
In this document the position of Mars as seen from Earth will be calculated using a
simple two body Keplerian orbit solution from supplied orbital elements. The task
of calculating the orbital elements themselves is a more complex one, a method for
the simpler case of binary systems (where the observations are made from outside the
system) is presented in [4].
The calculated apparent orbit will then be compared with accurate results obtained
from NASA[2]. More specifically the orbit of Mars during a period of retrograde motion
will be examined. Any discrepancies should be more visually apparent at this time as
the motion of Mars will appear circular - not just a relatively straight line.
This problem has two distinct elements. Firstly the orbits of both Earth and Mars in
their orbital planes must be calculated. Then a series of co-ordinate transformations is
required to obtain the orbit of Mars in the desired geocentric reference frame.

2 Position in Orbital Plane

It can be shown[5] that the following equations govern the orbits for the simplified two
body problem:

M = E − sin(E) (1)
1/2
f 1+ E
    
tan = tan (2)
2 1− 2
 
r = a 1 − cos(E) (3)

Where  is the eccentricity and a the semi-major axis. M is the mean anomaly - the
angle to the orbiting body from the center of its orbit were it moving at a constant
angular velocity of 2π/P (where P is the period). E is the eccentric anomaly - the
actual angle to the body from the center of the ellipse and f is the angle from the other
body.
Given an initial angle and a period it is possible to calculate M . E can then be found
numerically using equation 1, this yields f and r from equations 2 and 3 respectively.
In this manner the position of the orbiting body in the orbital plane can be calculated
for any desired time.

2
3 Co-Ordinate Systems

The position and orientation of the two dimensional orbital plane in three dimensional
space is specified by three parameters Ω, ω and i. This orientation is shown in figure 1.

z
z’
y’

x’
P
y

Figure 1: The orientation of the orbit in three dimensional space is specified by three
parameters Ω, ω and i.

In this system the Sun must be at the origin but the orientation of the axes is not set
and can even vary with time (in which case Ω, ω and i will depend on time). There
are many standard reference frames for our solar system, throughout this report the
J2000/DE200 system will be used. This system is fixed with respect to the distant stars
with its x − y plane coinciding with the orbital plane of the earth. The x axis points to
the vernal equinox and a position for the planet (mean longitude) is given for January
1 2000.
In reality the orbital planes of the planets change slowly over time due to the effects of
other bodies (such as the other planets). As a result the orbital plane of the Earth is
not exactly aligned with the x − y plane of the J2000 coordinate system. To allow for
these effects orbital parameters are usually given along with their rates of change.

3
4 Geocentric Transformation

The first step to computing the geocentric orbit of Mars is to obtain the orbit of Mars
and Earth in the same reference frame. Assuming the orbits have been calculated in the
x0 y 0 z 0 reference frames corresponding to their respective planets (see figure 1) a series of
transformations can be applied to transform them to the J2000 (xyz) frame. The first
transformation is a rotation about the z 0 axis to bring the x0 axis into the x − y plane.
The transformation matrix and resultant co-ordinate system is:
z
z’

y’
 
cos(ω − Ω) −sin(ω − Ω) 0
P
T1 =  sin(ω − Ω) cos(ω − Ω) 0 
 
y
0 0 1
i
x’
x
A rotation about the x0 axis is then carried out to align the z 0 axis with the z axis:
z’

 
1 0 0 y’
T2 =  0 cos(i) −sin(i) 
 
0 sin(i) cos(i) y

x’
x
Finally the x0 y 0 z 0 co-ordinate system is brought in line with the desired xyz system by
a rotation about the z 0 axis:
z’

 
cos(Ω) −sin(Ω) 0
T3 =  sin(Ω) cos(Ω) 0 
 
y’
0 0 1

x’
The position of Mars and Earth can therefore easily be transformed to the heliocentric
reference frame using the above matrices:

~h = T3 ∗ T2 ∗ T1 ∗ ~r (4)

4
Where ~r is the position in the orbital plane and ~h is the position in the heliocentric
system. To verify the results obtained at this point, they can be compared with those
produced by NSSDC’s heliospheric calculator[3].
Once the heliocentric positions are obtained the position of Mars relative to the Earth
is easily found by subtracting the position of the Earth:

~g = M
M ~ h − E~h (5)

The subscript indicates the reference frame (heliocentric or geocentric) and the main
symbol the planet. This gives the position of Mars as seen from the Earth, however
to put this into the standard geocentric reference frame the x − y axis must co-incide
with the Earth’s equatorial plane. Recalling that the x axis points to the vernal equinox
a rotation about the x axis will achieve this. Taking I as the tilt of the Earth’s axis
(approximately 23◦ 270 ) the appropriate transformation matrix is:

 
1 0 0
T4 =  0 cos(I) −sin(I) 
 
0 sin(I) cos(I)

It should be noted that there is an approximation in this last step. It does not take
into account the inclination of the Earth’s orbit from the x − y plane and it assumes
that the x axis points exactly at the vernal equinox. At present these are reasonable
assumptions as the Earth’s axis is only inclined 0.00005◦ [1] to the x − y axis and the
vernal equinox is only changing very slowly (precise values were not obtained).
It should also be noted that to obtain the most accurate results the transformation
matrices need to be recalculated for each position evaluation. This is due to the changing
planetary elements, a cursory examination of the rates of change (see [1]) reveals this to
be a very small effect, nonetheless it is easy to implement.

5 Results

The calculations were performed with two sets of orbital elements, one set from a text-
book [7] and one from NASA [1]. The elements given in the textbook specified no
inclination for the Earth, that is the Earth’s orbital plane is fixed in the x − y plane of
the co-ordinate system. As previously discussed the effect of the Earth’s inclination is
negligible so this shouldn’t introduce too much error.
The orbit of Mars between mid June and mid November 2003 is shown in figures 2 and
3 for both sets of orbital elements. The NASA orbital elements clearly describe the
retrograde motion more accurately as can be seen in Figures 2, 3 and 4. This is not
surprising considering that they come from a newer source and take into account the
change in the Earth’s orbital plane.

5
−8
computed
NASA
−10

−12
Dec °

−14

−16

−18
345 340 335 330 325
°
RA

Figure 2: The orbit of Mars mid June to mid November 2003 using the orbital elements
from the PH3003 hand out[7].

−8
computed
NASA
−10

−12
Dec °

−14

−16

−18
345 340 335 330 325
RA °

Figure 3: The orbit of Mars mid June to mid November 2003 using the orbital elements
from NASA[1].

6
PH3003 Hand Out Elements NASA Elements
.5 0.3

.4
Proportion of Positions

0.2
.3

.2
0.1

.1

0 0
0 0.5 1 1.5 2 0 0.05 0.1 0.15 0.2
°
Error

Figure 4: The resultant error of the orbital position over the period 2002-2004.

6 Conclusion

The orbit of Mars as seen from Earth was calculated for two sets of orbital elements.
The results agreed quite well with those obtained from NASA. The orbital elements
obtained from NASA produced a better fit to the retrograde motion and the motion as
a whole. The specified accuracy of 0.07◦ for NASA’s orbital elements was obtained for
over 95% of calculations. It should be noted that the calculations have been compared
with the correct positions as specified by NASA, it would be more conclusive to compare
the calculations with position as given by an independent source.

7
A Planet Data
%GetPlanetData
%Klaas Hartmann
%September 2002
%
%Gets the planetary data associated with a planet.
%Planets are numbered outwards from the sun (Earth is 3 and Mars is 4).
%Source is the source of the data 1 is the PH3003 hand-out, 2 is the orbital
%elements from NASA
function Planets = GetPlanetData(Planet,Source),

switch Planet,
case 3, %Earth
Planets.RadPerDay = 2*pi/365.256;
Planets.RadPerCentury = MyDMS(0,0,129597740.63);
Planets.inclination = MyDMS(23,27,0);
if Source == 1,
Planets.aBase = 1;
Planets.aUpdate = 0;
Planets.eUpdate = -0.000042;
Planets.eBase = 0.016750+Planets.eUpdate;
Planets.iBase = 0;
Planets.iUpdate = 0;
Planets.oBase = 0;
Planets.oUpdate = 0;
Planets.wUpdate = MyDMS(0,0,6180);
Planets.wBase = MyDMS(101,13,11)+Planets.wUpdate;
Planets.start = MyDMS(99,35,18);
Planets.startTime = -0.5;
else
Planets.aBase = 1.00000011;
Planets.aUpdate = -0.00000005;
Planets.eBase = 0.01671022;
Planets.eUpdate = -0.00003804;
Planets.iBase = deg2rad(0.00005);
Planets.iUpdate = MyDMS(0,0,-46.94);
Planets.oBase = deg2rad(-11.26064);
Planets.oUpdate = MyDMS(0,0,-18228.25);
Planets.wBase = deg2rad(102.94719);
Planets.wUpdate = MyDMS(0,0,1198.28);
Planets.start = deg2rad(100.46435);
Planets.startTime = 0;
end
case 4, %Mars
Planets.RadPerDay=2*pi/686.980;
Planets.RadPerCentury = MyDMS(0,0,68905103.78);
if Source == 1,
Planets.aBase = 1.523679;
Planets.aUpdate = 0;
Planets.eUpdate = 0.000094;
Planets.eBase = 0.093310+Planets.eUpdate;
Planets.iUpdate = MyDMS(0,0,-2.3);
Planets.iBase = MyDMS(1,51,1.1)+Planets.iUpdate;
Planets.oUpdate = MyDMS(0,0,2786);
Planets.oBase = MyDMS(48,47,12)+Planets.oUpdate;
Planets.wUpdate = MyDMS(0,0,6626);
Planets.wBase = MyDMS(334,13,6)+Planets.wUpdate;

8
Planets.start = MyDMS(144,20,70);
Planets.startTime = -0.5;
else
Planets.aBase = 1.52366231;
Planets.aUpdate = -0.00007221;
Planets.eBase = 0.09341233;
Planets.eUpdate = 0.00011902;
Planets.iBase = deg2rad(1.85061);
Planets.iUpdate = MyDMS(0,0,-25.47);
Planets.oBase = deg2rad(49.57854);
Planets.oUpdate = MyDMS(0,0,-1020.19);
Planets.wBase = deg2rad(336.04084);
Planets.wUpdate = MyDMS(0,0,1560.78);
Planets.start = deg2rad(355.45332);
Planets.startTime = 0;
end
otherwise,
error(’Planet not yet implemented’);
end

%Quick conversion function for dms to radians


function rads = MyDMS(d,m,s),
rads = (d/360+m/(360*60)+s/(360*3600))*2*pi;

9
B Calculation of Position in Orbital Plane
%Orbit
%Klaas Hartmann
%September 2002
%
%Calculates the position for an orbiting body at specific times given the orbital parameters
%
% f: true anomaly
% r: distance from sun
% TDays/TYears: time of the above calculed positions in days and years since 2000
%
% Planet: orbital parameters
% Start/Stop/TYears: Positions are calculated in 1 day intervals from Start to Stop
% if TYears has been specified it will be used instead
%
function [f,r,TDays,TYears] = Orbit(Planet,Start,Stop,TYears),

%Setup the time frame


switch nargin,
case 3, %Tyears was not specified
TDays = yearToDays(Start)-1:1:yearToDays(Stop)-1;
TYears = (DaysToYears(TDays(1),TDays(length(TDays))))/100;
case 4, %Tyears was specified
TDays = zeros(size(TYears));
otherwise,
error(’invalid number of input arguments’);
end

%Setup the vectors


E = zeros(length(TYears),1);
f = E;
r = E;
index = 1;

%Calculate mean anomaly at the start of 2000


startPos = Planet.start-Planet.wBase - Planet.RadPerCentury*Planet.startTime;

%For each day calculate the distance from sun and the angle from perihelion
for index = 1:length(TYears);

%Calculate the approximate eccentricity and semi-major axis


e = Planet.eBase+Planet.eUpdate*TYears(index);
a = Planet.aBase+Planet.aUpdate*TYears(index);

%Calculate the eccentric anomaly (angle for a circular orbit)


M = Planet.RadPerCentury*(TYears(index))+startPos;

%Solve for the approximated actual angle


E(index)=fzero(@Efun,M+e*sin(M),[],e,M);
f(index) = 2*atan(((1+e)/(1-e))^0.5*tan(E(index)/2));

%Calculate the distance from sun


r(index) = (a*cos(E(index))-a*e)./cos(f(index));
end

function result = Efun(Evalue,e,M),


result = M + e * sin(Evalue)-Evalue;

10
C Transformation to J2000/DE200
%CartesianHelio
%Klaas Hartmann
%September 2002
%
%Converts the standard distance/angle measure in the orbital plane
%to heliocentric cartesian co-ordinates.
%
% Planet: Orbital Elements
% r: Separation
% f: True Anomaly
% TYears: Time in years of each calculation
%
% Final: Final cartesian co-ordinates
%
function [Final] = CartesianHelio(Planet,r,f,TYears),

%The number of points in this data set


observations = length(f);

%Transform to cartesian with x-y plane in plane of orbit and the x axis
%pointing to perihelion
Trans = [r.*cos(f) r.*sin(f) zeros(observations,1)];

%Allocate the final matrix


Final = zeros(size(Trans));

%Transform the co-ordinates for each observation


for index = 1:length(TYears);

%Calculate orbital parameters for this time


w = Planet.wBase + Planet.wUpdate*TYears(index);
o = Planet.oBase + Planet.oUpdate*TYears(index);
i = Planet.iBase + Planet.iUpdate*TYears(index);
w = w-o;

%Calculate Transformation Matrices

%Drop the perihelion to the Ecliptic (Rotation about z axis)


TM1 = [cos(w) -sin(w) 0; sin(w) cos(w) 0; 0 0 1];

%Tilt the co-ordinate system to bring x-y plane into the


%ecliptic (rotation about x axis)
TM2 = [1 0 0; 0 cos(i) -sin(i); 0 sin(i) cos(i)];

%Bring the ascending node to the vernal equinox


%(Rotation about z axis)
TM3 = [cos(o) -sin(o) 0; sin(o) cos(o) 0; 0 0 1];

%Calculate complete transformation matrix


TM = TM3*TM2*TM1;

%Finally apply the transformation


Final(index,:) = Trans(index,:)*TM’;
end

11
D Transformation to Geocentric Orbit
%Orbits
%Klaas Hartmann
%September 2002
%
% Calculates the orbit of Mars as seen from Earth
%
% MarsFinal: The orbit of Mars in cartesian form
% TYears: The dates for the calculated values in years since 2002
% Source: The source for the orbital elements (1: PH3003 Hand Out 2: NASA)
% Start/End: The period over which to calculate the orbit
%
function [MarsFinal,TYears] = Orbits(Source,Start,End)

%Get the planetary orbital elements


EarthData = GetPlanetData(3,Source);
MarsData = GetPlanetData(4,Source);

%Calculate the heliocentric 2D orbits


[EarthF EarthR TDays TYears] = Orbit(EarthData,Start,End);
[MarsF MarsR] = Orbit(MarsData,Start,End);

%Calculate the heliocentric 3D orbits


EarthHC = CartesianHelio(EarthData,EarthR,EarthF,TYears);
MarsHC = CartesianHelio(MarsData,MarsR,MarsF,TYears);

%Center the orbit on Earth


EarthCentered = MarsHC-EarthHC;

%MarsFinal = EarthCentered;

%Tilt the orbit to align x-y axis with with the equatorial plane
for index = 1:length(TYears);
i = EarthData.iBase + EarthData.iUpdate*TYears(index);
H = (EarthData.inclination+i); %+ or - i ???
TM = [1 0 0; 0 cos(H) -sin(H); 0 sin(H) cos(H)];
MarsFinal(index,:) = EarthCentered(index,:)*TM’;
end

12
References

[1] Solar System Dynamics Group, NASA Planetary Orbital Elements


http://ssd.jpl.nasa.gov/elem_planets.html

[2] Solar System Dynamics Group, NASA Horizons


http://ssd.jpl.nasa.gov/horizons.html

[3] National Space Science Data Center, NASA Heliospheric Planet Coordinates
http://nssdc.gsfc.nasa.gov/space/helios/planet.html

[4] Klaas Hartmann Computing the Orbital Parameters of Binary Systems

[5] W. M. Smart Spherical Astronomy

[6] D.T. Lyons Planetary Constants and Motion

[7] PH3003 Handout

13

You might also like