#include <EarthOrbit.h>
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. |
Definition at line 17 of file EarthOrbit.h.
|
|
Definition at line 39 of file EarthOrbit.cxx. 00040 {
00041 initialize();
00042 }
|
|
||||||||||||
|
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 }
|
|
|
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 }
|
|
|
Orbit calculation.
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 }
|
|
|
Definition at line 40 of file EarthOrbit.h. |
|
|
Definition at line 42 of file EarthOrbit.h. |
|
|
Definition at line 47 of file EarthOrbit.h. |
|
|
Definition at line 47 of file EarthOrbit.h. |
|
|
Definition at line 41 of file EarthOrbit.h. |
|
|
Definition at line 43 of file EarthOrbit.h. |
|
|
Definition at line 45 of file EarthOrbit.h. |
|
|
Definition at line 44 of file EarthOrbit.h. |
|
|
Definition at line 30 of file EarthOrbit.cxx. |
|
|
Definition at line 32 of file EarthOrbit.cxx. |
|
|
Definition at line 31 of file EarthOrbit.cxx. |
|
|
Definition at line 34 of file EarthOrbit.cxx. |
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001