Reverted FindPositionSDP4() to simpler version

feature/19
Daniel Warner 2011-04-01 14:40:44 +01:00
parent 0ea44e5bd8
commit 72452918df
2 changed files with 21 additions and 17 deletions

View File

@ -256,12 +256,12 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) {
/* /*
* the final values * the final values
*/ */
double e = Eccentricity(); double e;
double a; double a;
double omega; double omega;
double xl; double xl;
double xnode; double xnode;
double xincl = Inclination(); double xincl;
/* /*
* update for secular gravity and atmospheric drag * update for secular gravity and atmospheric drag
@ -270,8 +270,6 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) {
double omgadf = ArgumentPerigee() + i_omgdot_ * tsince; double omgadf = ArgumentPerigee() + i_omgdot_ * tsince;
const double xnoddf = AscendingNode() + i_xnodot_ * tsince; const double xnoddf = AscendingNode() + i_xnodot_ * tsince;
omega = omgadf;
const double tsq = tsince * tsince; const double tsq = tsince * tsince;
xnode = xnoddf + i_xnodcf_ * tsq; xnode = xnoddf + i_xnodcf_ * tsq;
double tempa = 1.0 - i_c1_ * tsince; double tempa = 1.0 - i_c1_ * tsince;
@ -279,17 +277,18 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) {
double templ = i_t2cof_ * tsq; double templ = i_t2cof_ * tsq;
double xn = RecoveredMeanMotion(); double xn = RecoveredMeanMotion();
e = Eccentricity();
xincl = Inclination();
/* t, xll, omgasm, xnodes, em, xinc, xn */ DeepSpaceSecular(tsince, xmdf, omgadf, xnode, e, xincl, xn);
DeepSpaceSecular(tsince, xmdf, omega, xnode, e, xincl, xn);
if (xn <= 0.0) { if (xn <= 0.0) {
throw new SatelliteException("Error: 2 (xn <= 0.0)"); throw new SatelliteException("Error: 2 (xn <= 0.0)");
} }
a = pow(constants_.XKE / xn, constants_.TWOTHRD) * pow(tempa, 2.0); a = pow(constants_.XKE / xn, constants_.TWOTHRD) * pow(tempa, 2.0);
e -= tempe; e -= tempe;
/* /*
* fix tolerance for error recognition * fix tolerance for error recognition
*/ */
@ -302,14 +301,18 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) {
if (e < 1.0e-6) if (e < 1.0e-6)
e = 1.0e-6; e = 1.0e-6;
/*
xmdf += RecoveredMeanMotion() * templ; xmdf += RecoveredMeanMotion() * templ;
double xlm = xmdf + omega + xnode; double xlm = xmdf + omgadf + xnode;
xnode = fmod(xnode, Globals::TWOPI()); xnode = fmod(xnode, Globals::TWOPI());
omega = fmod(omega, Globals::TWOPI()); omgadf = fmod(omgadf, Globals::TWOPI());
xlm = fmod(xlm, Globals::TWOPI()); xlm = fmod(xlm, Globals::TWOPI());
double xmam = fmod(xlm - omega - xnode, Globals::TWOPI()); double xmam = fmod(xlm - omgadf - xnode, Globals::TWOPI());
*/
DeepSpacePeriodics(tsince, e, xincl, omega, xnode, xmam); double xmam = xmdf + RecoveredMeanMotion() * templ;
DeepSpacePeriodics(tsince, e, xincl, omgadf, xnode, xmam);
/* /*
* keeping xincl positive important unless you need to display xincl * keeping xincl positive important unless you need to display xincl
@ -318,10 +321,11 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) {
if (xincl < 0.0) { if (xincl < 0.0) {
xincl = -xincl; xincl = -xincl;
xnode += Globals::PI(); xnode += Globals::PI();
omega -= Globals::PI(); omgadf -= Globals::PI();
} }
xl = xmam + omega + xnode; xl = xmam + omgadf + xnode;
omega = omgadf;
if (e < 0.0 || e > 1.0) { if (e < 0.0 || e > 1.0) {
throw new SatelliteException("Error: 3 (e < 0.0 || e > 1.0)"); throw new SatelliteException("Error: 3 (e < 0.0 || e > 1.0)");

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 ----------------------
@ -176,7 +176,7 @@ void RunTest() {
RunTle(Tle("06251", RunTle(Tle("06251",
"1 06251U 62025E 06176.82412014 .00008885 00000-0 12808-3 0 3985", "1 06251U 62025E 06176.82412014 .00008885 00000-0 12808-3 0 3985",
"2 06251 58.0579 54.0425 0030035 139.1568 221.1854 15.56387291 6774"), 0.0, 2880.0, 120.0); "2 06251 58.0579 54.0425 0030035 139.1568 221.1854 15.56387291 6774"), 0.0, 2880.0, 120.0);
#endif
/* /*
# MOLNIYA 2-14 # 12h resonant ecc in 0.65 to 0.7 range # MOLNIYA 2-14 # 12h resonant ecc in 0.65 to 0.7 range
@ -187,7 +187,7 @@ void RunTest() {
"1 08195U 75081A 06176.33215444 .00000099 00000-0 11873-3 0 813", "1 08195U 75081A 06176.33215444 .00000099 00000-0 11873-3 0 813",
"2 08195 64.1586 279.0717 6877146 264.7651 20.2257 2.00491383225656"), 0.0, 2880.0, 120.0); "2 08195 64.1586 279.0717 6877146 264.7651 20.2257 2.00491383225656"), 0.0, 2880.0, 120.0);
return;
/* /*
# MOLNIYA 1-36 ## fig 12h resonant ecc in 0.7 to 0.715 range # MOLNIYA 1-36 ## fig 12h resonant ecc in 0.7 to 0.715 range
1 09880U 77021A 06176.56157475 .00000421 00000-0 10000-3 0 9814 1 09880U 77021A 06176.56157475 .00000421 00000-0 10000-3 0 9814
@ -216,7 +216,7 @@ void RunTest() {
RunTle(Tle("11801", RunTle(Tle("11801",
"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);
//#endif
/* /*
# EUTELSAT 1-F1 (ECS1)## fig lyddane choice in GSFC at 2080 min # EUTELSAT 1-F1 (ECS1)## fig lyddane choice in GSFC at 2080 min