Rearrange resonant/synchro orbit init code

feature/19
Daniel Warner 2011-03-31 22:12:07 +01:00
parent 01573c3e4f
commit e0e080db30
2 changed files with 104 additions and 105 deletions

View File

@ -782,11 +782,36 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d
*/ */
d_resonance_flag_ = false; d_resonance_flag_ = false;
d_synchronous_flag_ = false; d_synchronous_flag_ = false;
bool initialize_integrator = true; bool initialize_integrator = false;
if (RecoveredMeanMotion() < 0.0052359877 && RecoveredMeanMotion() > 0.0034906585) { if (RecoveredMeanMotion() < 0.0052359877 && RecoveredMeanMotion() > 0.0034906585) {
if (RecoveredMeanMotion() < 8.26e-3 || RecoveredMeanMotion() > 9.24e-3 || Eccentricity() < 0.5) { /*
* 24h synchronous resonance terms initialization
*/
d_resonance_flag_ = true;
d_synchronous_flag_ = true;
const double g200 = 1.0 + eosq * (-2.5 + 0.8125 * eosq);
const double g310 = 1.0 + 2.0 * eosq;
const double g300 = 1.0 + eosq * (-6.0 + 6.60937 * eosq);
const double f220 = 0.75 * (1.0 + cosio) * (1.0 + cosio);
const double f311 = 0.9375 * sinio * sinio * (1.0 + 3.0 * cosio) - 0.75 * (1.0 + cosio);
double f330 = 1.0 + cosio;
f330 = 1.875 * f330 * f330 * f330;
d_del1_ = 3.0 * RecoveredMeanMotion() * RecoveredMeanMotion() * aqnv * aqnv;
d_del2_ = 2.0 * d_del1_ * f220 * g200 * Q22;
d_del3_ = 3.0 * d_del1_ * f330 * g300 * Q33 * aqnv;
d_del1_ = d_del1_ * f311 * g310 * Q31 * aqnv;
d_fasx2_ = 0.13130908;
d_fasx4_ = 2.8843198;
d_fasx6_ = 0.37448087;
d_xlamo_ = MeanAnomoly() + AscendingNode() + ArgumentPerigee() - i_gsto_;
bfact = xmdot + xpidot - THDT;
bfact += d_ssl_ + d_ssg_ + d_ssh_;
} else if (RecoveredMeanMotion() < 8.26e-3 || RecoveredMeanMotion() > 9.24e-3 || Eccentricity() < 0.5) {
initialize_integrator = false; initialize_integrator = false;
} else { } else {
/* /*
@ -883,32 +908,6 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d
bfact = xmdot + xnodot + xnodot - THDT - THDT; bfact = xmdot + xnodot + xnodot - THDT - THDT;
bfact = bfact + d_ssl_ + d_ssh_ + d_ssh_; bfact = bfact + d_ssl_ + d_ssh_ + d_ssh_;
} }
} else {
/*
* 24h synchronous resonance terms initialization
*/
d_resonance_flag_ = true;
d_synchronous_flag_ = true;
const double g200 = 1.0 + eosq * (-2.5 + 0.8125 * eosq);
const double g310 = 1.0 + 2.0 * eosq;
const double g300 = 1.0 + eosq * (-6.0 + 6.60937 * eosq);
const double f220 = 0.75 * (1.0 + cosio) * (1.0 + cosio);
const double f311 = 0.9375 * sinio * sinio * (1.0 + 3.0 * cosio) - 0.75 * (1.0 + cosio);
double f330 = 1.0 + cosio;
f330 = 1.875 * f330 * f330 * f330;
d_del1_ = 3.0 * RecoveredMeanMotion() * RecoveredMeanMotion() * aqnv * aqnv;
d_del2_ = 2.0 * d_del1_ * f220 * g200 * Q22;
d_del3_ = 3.0 * d_del1_ * f330 * g300 * Q33 * aqnv;
d_del1_ = d_del1_ * f311 * g310 * Q31 * aqnv;
d_fasx2_ = 0.13130908;
d_fasx4_ = 2.8843198;
d_fasx6_ = 0.37448087;
d_xlamo_ = MeanAnomoly() + AscendingNode() + ArgumentPerigee() - i_gsto_;
bfact = xmdot + xpidot - THDT;
bfact = bfact + d_ssl_ + d_ssg_ + d_ssh_;
}
if (initialize_integrator) { if (initialize_integrator) {
d_xfact_ = bfact - RecoveredMeanMotion(); d_xfact_ = bfact - RecoveredMeanMotion();

View File

@ -144,7 +144,7 @@ void RunTle(Tle tle, double start, double end, double inc) {
void RunTest() { void RunTest() {
//#if 0 #if 0
/* /*
# ------------------ Verification test cases ---------------------- # ------------------ Verification test cases ----------------------
@ -207,7 +207,7 @@ void RunTest() {
"1 09998U 74033F 05148.79417928 -.00000112 00000-0 00000+0 0 4480", "1 09998U 74033F 05148.79417928 -.00000112 00000-0 00000+0 0 4480",
"2 09998 9.4958 313.1750 0270971 327.5225 30.8097 1.16186785 45878"), -1440.0, -720.0, 60.0); "2 09998 9.4958 313.1750 0270971 327.5225 30.8097 1.16186785 45878"), -1440.0, -720.0, 60.0);
#endif
/* /*
# # Original STR#3 SDP4 test # # Original STR#3 SDP4 test
1 11801U 80230.29629788 .01431103 00000-0 14311-1 13 1 11801U 80230.29629788 .01431103 00000-0 14311-1 13
@ -217,7 +217,7 @@ void RunTest() {
"1 11801U 80230.29629788 .01431103 00000-0 14311-1 13", "1 11801U 80230.29629788 .01431103 00000-0 14311-1 13",
"2 11801 46.7916 230.4354 7318036 47.4722 10.4117 2.28537848 13"), 0.0, 1440.0, 360.0); "2 11801 46.7916 230.4354 7318036 47.4722 10.4117 2.28537848 13"), 0.0, 1440.0, 360.0);
return;
/* /*
# EUTELSAT 1-F1 (ECS1)## fig lyddane choice in GSFC at 2080 min # EUTELSAT 1-F1 (ECS1)## fig lyddane choice in GSFC at 2080 min
1 14128U 83058A 06176.02844893 -.00000158 00000-0 10000-3 0 9627 1 14128U 83058A 06176.02844893 -.00000158 00000-0 10000-3 0 9627