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_synchronous_flag_ = false;
bool initialize_integrator = true;
bool initialize_integrator = false;
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;
} else {
/*
@ -883,32 +908,6 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d
bfact = xmdot + xnodot + xnodot - THDT - THDT;
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) {
d_xfact_ = bfact - RecoveredMeanMotion();

View File

@ -144,7 +144,7 @@ void RunTle(Tle tle, double start, double end, double inc) {
void RunTest() {
//#if 0
#if 0
/*
# ------------------ Verification test cases ----------------------
@ -207,7 +207,7 @@ void RunTest() {
"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);
#endif
/*
# # Original STR#3 SDP4 test
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",
"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
1 14128U 83058A 06176.02844893 -.00000158 00000-0 10000-3 0 9627
@ -381,7 +381,7 @@ void RunTest() {
RunTle(Tle("28350",
"1 28350U 04020A 06167.21788666 .16154492 76267-5 18678-3 0 8894",
"2 28350 64.9977 345.6130 0024870 260.7578 99.9590 16.47856722116490"), 0.0, 2880.0, 120.0);
//#endif
//#endif
/*
# H-2 R/B # Deep space, perigee = 135.75 (<156) s4 mod
@ -392,7 +392,7 @@ void RunTest() {
"1 28623U 05006B 06177.81079184 .00637644 69054-6 96390-3 0 6000",
"2 28623 28.5200 114.9834 6249053 170.2550 212.8965 3.79477162 12753"), 0.0, 1440.0, 120.0);
// return;
// return;
/*
# XM-3 # 24h resonant geo, incl < 3 deg goes
# # negative around 1130 min