Added limits to modified eccentricity

feature/19
Daniel Warner 2011-03-27 13:34:54 +01:00
parent 2a7760db23
commit a23bb2b119
1 changed files with 17 additions and 0 deletions

View File

@ -262,6 +262,23 @@ void SGDP4::FindPosition(double tsince) {
xl = xmp + tsince_arg_perigee + xnode + RecoveredMeanMotion() * templ; xl = xmp + tsince_arg_perigee + xnode + RecoveredMeanMotion() * templ;
} }
if (a < 1.0) {
throw new SatelliteException("Error: Satellite crashed (a < 1.0)");
}
if (tsince_eccentricity < -1.0e-3) {
throw new SatelliteException("Error: Modified eccentricity too low (e < -1.0e-3)");
}
/*
* create limits to modified eccentricity
*/
if (tsince_eccentricity < 1.0e-6) {
tsince_eccentricity = 1.0e-6;
} else if (tsince_eccentricity > 1.0 - 1.0e-6) {
tsince_eccentricity = 1.0 - 1.0e-6;
}
double beta = sqrt(1.0 - tsince_eccentricity * tsince_eccentricity); double beta = sqrt(1.0 - tsince_eccentricity * tsince_eccentricity);
double xn = Globals::XKE() / pow(a, 1.5); double xn = Globals::XKE() / pow(a, 1.5);
/* /*