Moved calculate dot terms into seperate function
parent
23877a56c4
commit
c4dd1f28be
61
SGDP4.cpp
61
SGDP4.cpp
|
@ -1013,14 +1013,8 @@ void SGDP4::DeepPeriodics(const double& t, double& em,
|
|||
* omegaq = omegao
|
||||
*/
|
||||
void SGDP4::DeepSecular(const double& t, double& xll, double& omgasm,
|
||||
double& xnodes, double& em, double& xinc, double& xn,
|
||||
const double& omgdot, const double& omegaq) {
|
||||
double& xnodes, double& em, double& xinc, double& xn) {
|
||||
|
||||
static const double G22 = 5.7686396;
|
||||
static const double G32 = 0.95240898;
|
||||
static const double G44 = 1.8014998;
|
||||
static const double G52 = 1.0508330;
|
||||
static const double G54 = 4.4108898;
|
||||
static const double THDT = 4.3752691E-3;
|
||||
|
||||
static const double step = 720.0;
|
||||
|
@ -1065,9 +1059,39 @@ void SGDP4::DeepSecular(const double& t, double& xll, double& omgasm,
|
|||
*/
|
||||
d_xli_ = d_xli_ + xldot * delt + xndot * step2;
|
||||
d_xni_ = d_xni_ + xndot * delt + xnddt * step2;
|
||||
|
||||
DeepSpaceCalcDotTerms(xndot, xnddt, xldot);
|
||||
|
||||
d_atime_ += delt;
|
||||
ft = t - d_atime_;
|
||||
} while (fabs(ft) >= step);
|
||||
}
|
||||
|
||||
/*
|
||||
* dot terms calculated
|
||||
* integrator
|
||||
*/
|
||||
xn = d_xni_ + xndot * ft + xnddt * ft * ft * 0.5;
|
||||
|
||||
double xl = d_xli_ + xldot * ft + xndot * ft * ft * 0.5;
|
||||
double temp = -xnodes + i_gsto_ + t * THDT;
|
||||
|
||||
if (!d_synchronous_flag_)
|
||||
xll = xl + temp + temp;
|
||||
else
|
||||
xll = xl - omgasm + temp;
|
||||
}
|
||||
|
||||
/*
|
||||
* calculate dot terms
|
||||
*/
|
||||
void SGDP4::DeepSpaceCalcDotTerms(double& xndot, double& xnddt, double& xldot) {
|
||||
|
||||
static const double G22 = 5.7686396;
|
||||
static const double G32 = 0.95240898;
|
||||
static const double G44 = 1.8014998;
|
||||
static const double G52 = 1.0508330;
|
||||
static const double G54 = 4.4108898;
|
||||
|
||||
if (d_synchronous_flag_) {
|
||||
|
||||
xndot = d_del1_ * sin(d_xli_ - d_fasx2_) + d_del2_ * sin(2.0 * (d_xli_ - d_fasx4_))
|
||||
|
@ -1078,7 +1102,7 @@ void SGDP4::DeepSecular(const double& t, double& xll, double& omgasm,
|
|||
|
||||
} else {
|
||||
|
||||
const double xomi = omegaq + omgdot * d_atime_;
|
||||
const double xomi = ArgumentPerigee() + i_omgdot_ * d_atime_;
|
||||
const double x2omi = xomi + xomi;
|
||||
const double x2li = d_xli_ + d_xli_;
|
||||
|
||||
|
@ -1103,24 +1127,7 @@ void SGDP4::DeepSecular(const double& t, double& xll, double& omgasm,
|
|||
+ d_d5421_ * cos(xomi + x2li - G54)
|
||||
+ d_d5433_ * cos(-xomi + x2li - G54));
|
||||
}
|
||||
|
||||
xldot = d_xni_ + d_xfact_;
|
||||
xnddt = xnddt * xldot;
|
||||
|
||||
d_atime_ += delt;
|
||||
ft = t - d_atime_;
|
||||
} while (fabs(ft) >= step);
|
||||
}
|
||||
|
||||
/*
|
||||
* integrator
|
||||
*/
|
||||
xn = d_xni_ + xndot * ft + xnddt * ft * ft * 0.5;
|
||||
|
||||
double xl = d_xli_ + xldot * ft + xndot * ft * ft * 0.5;
|
||||
double temp = -xnodes + i_gsto_ + t * THDT;
|
||||
|
||||
if (!d_synchronous_flag_)
|
||||
xll = xl + temp + temp;
|
||||
else
|
||||
xll = xl - omgasm + temp;
|
||||
}
|
||||
|
|
1
SGDP4.h
1
SGDP4.h
|
@ -34,6 +34,7 @@ private:
|
|||
const double& xincl, const double& xlcof, const double& aycof,
|
||||
const double& x3thm1, const double& x1mth2, const double& x7thm1,
|
||||
const double& cosio, const double& sinio);
|
||||
void DeepSpaceCalcDotTerms(double& xndot, double& xnddt, double& xldot);
|
||||
|
||||
bool first_run_;
|
||||
|
||||
|
|
Loading…
Reference in New Issue