From 72452918df38d4a6532beab76a161d5e9c16073c Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Fri, 1 Apr 2011 14:40:44 +0100 Subject: [PATCH] Reverted FindPositionSDP4() to simpler version --- SGDP4.cpp | 30 +++++++++++++++++------------- main.cpp | 8 ++++---- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/SGDP4.cpp b/SGDP4.cpp index f7f7691..68c374a 100644 --- a/SGDP4.cpp +++ b/SGDP4.cpp @@ -256,12 +256,12 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) { /* * the final values */ - double e = Eccentricity(); + double e; double a; double omega; double xl; double xnode; - double xincl = Inclination(); + double xincl; /* * update for secular gravity and atmospheric drag @@ -270,8 +270,6 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) { double omgadf = ArgumentPerigee() + i_omgdot_ * tsince; const double xnoddf = AscendingNode() + i_xnodot_ * tsince; - omega = omgadf; - const double tsq = tsince * tsince; xnode = xnoddf + i_xnodcf_ * tsq; double tempa = 1.0 - i_c1_ * tsince; @@ -279,17 +277,18 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) { double templ = i_t2cof_ * tsq; double xn = RecoveredMeanMotion(); + e = Eccentricity(); + xincl = Inclination(); - /* t, xll, omgasm, xnodes, em, xinc, xn */ - DeepSpaceSecular(tsince, xmdf, omega, xnode, e, xincl, xn); + DeepSpaceSecular(tsince, xmdf, omgadf, xnode, e, xincl, xn); if (xn <= 0.0) { throw new SatelliteException("Error: 2 (xn <= 0.0)"); } a = pow(constants_.XKE / xn, constants_.TWOTHRD) * pow(tempa, 2.0); - e -= tempe; + /* * fix tolerance for error recognition */ @@ -302,14 +301,18 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) { if (e < 1.0e-6) e = 1.0e-6; + /* xmdf += RecoveredMeanMotion() * templ; - double xlm = xmdf + omega + xnode; + double xlm = xmdf + omgadf + xnode; xnode = fmod(xnode, Globals::TWOPI()); - omega = fmod(omega, Globals::TWOPI()); + omgadf = fmod(omgadf, 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 @@ -318,10 +321,11 @@ void SGDP4::FindPositionSDP4(Eci& eci, double tsince) { if (xincl < 0.0) { xincl = -xincl; 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) { throw new SatelliteException("Error: 3 (e < 0.0 || e > 1.0)"); diff --git a/main.cpp b/main.cpp index 2a047af..f1d7333 100644 --- a/main.cpp +++ b/main.cpp @@ -144,7 +144,7 @@ void RunTle(Tle tle, double start, double end, double inc) { void RunTest() { - //#if 0 +#if 0 /* # ------------------ Verification test cases ---------------------- @@ -176,7 +176,7 @@ void RunTest() { RunTle(Tle("06251", "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); - +#endif /* # 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", "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 1 09880U 77021A 06176.56157475 .00000421 00000-0 10000-3 0 9814 @@ -216,7 +216,7 @@ void RunTest() { RunTle(Tle("11801", "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); - //#endif + /* # EUTELSAT 1-F1 (ECS1)## fig lyddane choice in GSFC at 2080 min