Main Page   Namespace List   Compound List   File List   Compound Members   File Members  

astro::EarthOrbit Class Reference

Postition of Earth satellite. More...

#include <EarthOrbit.h>

List of all members.

Public Methods

 EarthOrbit ()
void initialize ()
 set up for calculation, with orbital parameters currently wired in. More...

Hep3Vector position (JulianDate jd) const
 Orbit calculation. More...


Static Private Methods

double Kepler (double MeanAnomaly, double Eccentricity)
 calculate correction to phase for eccentricity. More...


Private Attributes

double m_M0
double m_dMdt
double m_Omega0
double m_dOmegadt
double m_w0
double m_dwdt
double m_a
double m_alt

Static Private Attributes

double s_altitude = 550.e3
double s_incl = 28.5*M_PI/180
double s_e = 0.
double s_radius = 6378145.


Detailed Description

Postition of Earth satellite.

Author:
G. Tosti original code , T. Burnett convert to class
Id:
EarthOrbit.h,v 1.1.1.1 2002/08/13 00:20:45 burnett Exp

Definition at line 17 of file EarthOrbit.h.


Constructor & Destructor Documentation

astro::EarthOrbit::EarthOrbit  
 

Definition at line 39 of file EarthOrbit.cxx.

00040 {
00041     initialize();
00042 }


Member Function Documentation

double astro::EarthOrbit::Kepler double    MeanAnomaly,
double    Eccentricity
[static, private]
 

calculate correction to phase for eccentricity.

Definition at line 96 of file EarthOrbit.cxx.

Referenced by position().

00097 {
00098     double E = MeanAnomaly;    // Initial guess to Eccentric Anomaly
00099     if( Eccentricity==0) return E; // THB: skip following
00100     double Error;
00101     double TrueAnomaly;
00102     
00103     do
00104     {
00105         Error = (E - Eccentricity*sin(E) - MeanAnomaly)
00106             / (1. - Eccentricity*cos(E));
00107         E -= Error;
00108     }
00109     while (fabs(Error) >= 0.000001);
00110     
00111     if (fabs(E-M_PI) < 0.000001)
00112         TrueAnomaly = M_PI;
00113     else
00114         TrueAnomaly = 2.*atan(sqrt((1.+Eccentricity)/(1.-Eccentricity))
00115         *tan(E/2.));
00116     if (TrueAnomaly < 0)
00117         TrueAnomaly += 2.*M_PI;
00118     
00119     return TrueAnomaly;
00120 }

void astro::EarthOrbit::initialize  
 

set up for calculation, with orbital parameters currently wired in.

Definition at line 44 of file EarthOrbit.cxx.

Referenced by EarthOrbit().

00045 {
00046     double sini = sin(s_incl), cosi = cos(s_incl);
00047     static double J2=1.0822e-3;
00048     
00049     m_alt=(s_radius + s_altitude)/1000.; //altitude in km
00050     m_a = 1.0 + s_altitude/s_radius; 
00051     
00052     double T = M_PI/2*pow(m_a,1.5)/sqrt(5.98e24*6.67e-11)*pow(s_radius,1.5)  ;  
00053     
00054     double u = 3.9860044e14/pow(s_radius,3)  ; 
00055     double n = sqrt(u / pow(m_a,3));
00056     double n1 = n*(1. + 3.*J2/2.*sqrt(1. - s_e*s_e)/(m_a*m_a)/pow((1. - s_e*s_e),2)*(1.-1.5*sini*sini));
00057     m_dwdt = n1*3.*J2/2./(m_a*m_a)/pow((1. - s_e*s_e),2)*(2. - 2.5*sini*sini);
00058     
00059     m_dOmegadt = -n1*3.*J2/2./(m_a*m_a)/pow((1. - s_e*s_e),2)*cosi;
00060     m_dMdt = n1;
00061     
00062     // phases for launch start
00063     // this is really the elapsed time in seconds since the MissionStart
00064     double StartSimDate = (JDStart-JD_missionStart) * SecondsPerDay;
00065     m_M0     = m_dMdt*StartSimDate;
00066     m_Omega0 = m_dOmegadt*StartSimDate;
00067     m_w0     = m_dwdt*StartSimDate;
00068     
00069     range(&m_M0,6.28); // should be 2pi
00070     
00071 }

Hep3Vector astro::EarthOrbit::position JulianDate    JD const
 

Orbit calculation.

Parameters:
jd  the Julian Date for the orbit calculation
Returns:
The orbit position (in inertial coordinates) in km

Definition at line 74 of file EarthOrbit.cxx.

Referenced by main().

00075 {
00076     double elapse = (JD - JDStart)*SecondsPerDay;
00077     
00078     double M=m_M0+m_dMdt*elapse;
00079     
00080     double Omega = m_Omega0+m_dOmegadt*elapse;
00081 
00082     // only for comparison with orbit.cpp -- should be 2pi
00083     range(&M,6.28);
00084     range(&Omega,6.28);
00085     
00086     double w = m_w0+m_dwdt*elapse;
00087     double Enew =Kepler(M,s_e); 
00088     
00089        
00090     Hep3Vector pos= Hep3Vector( cos(Enew)-s_e, sqrt(1.-sqr(s_e))*sin(Enew), 0 ).unit()*m_alt;
00091     pos.rotateZ(w).rotateX(s_incl).rotateZ(Omega);
00092  
00093     return pos;  
00094 }


Member Data Documentation

double astro::EarthOrbit::m_M0 [private]
 

Definition at line 40 of file EarthOrbit.h.

double astro::EarthOrbit::m_Omega0 [private]
 

Definition at line 42 of file EarthOrbit.h.

double astro::EarthOrbit::m_a [private]
 

Definition at line 47 of file EarthOrbit.h.

double astro::EarthOrbit::m_alt [private]
 

Definition at line 47 of file EarthOrbit.h.

double astro::EarthOrbit::m_dMdt [private]
 

Definition at line 41 of file EarthOrbit.h.

double astro::EarthOrbit::m_dOmegadt [private]
 

Definition at line 43 of file EarthOrbit.h.

double astro::EarthOrbit::m_dwdt [private]
 

Definition at line 45 of file EarthOrbit.h.

double astro::EarthOrbit::m_w0 [private]
 

Definition at line 44 of file EarthOrbit.h.

double astro::EarthOrbit::s_altitude = 550.e3 [static, private]
 

Definition at line 30 of file EarthOrbit.cxx.

double astro::EarthOrbit::s_e = 0. [static, private]
 

Definition at line 32 of file EarthOrbit.cxx.

double astro::EarthOrbit::s_incl = 28.5*M_PI/180 [static, private]
 

Definition at line 31 of file EarthOrbit.cxx.

double astro::EarthOrbit::s_radius = 6378145. [static, private]
 

Definition at line 34 of file EarthOrbit.cxx.


The documentation for this class was generated from the following files:
Generated on Wed Aug 14 10:09:36 2002 for astro by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001