Changed when integrator restarts

feature/19
Daniel Warner 2011-03-30 15:10:16 +01:00
parent 677482eb25
commit 6d93031501
1 changed files with 9 additions and 9 deletions

View File

@ -889,9 +889,9 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d
/* /*
* initialize integrator * initialize integrator
*/ */
d_xli_ = d_xlamo_;
d_xni_ = RecoveredMeanMotion();
d_atime_ = 0.0; d_atime_ = 0.0;
d_xni_ = RecoveredMeanMotion();
d_xli_ = d_xlamo_;
} }
} }
@ -1027,14 +1027,13 @@ void SGDP4::DeepSecular(const double& t, double& xll, double& omgasm,
return; return;
/* /*
* 1st condition (restart if tsince is less than one time step) * 1st condition (if d_atime_ is less than one time step from epoch)
* 2nd condition () * 2nd condition (if d_atime_ and t are of opposite signs, so zero crossing required)
* 3rd condition () * 3rd condition (if t is closer to zero than d_atime_)
*/ */
if (d_atime_ == 0 || if (fabs(d_atime_) < STEP ||
fabs(d_atime_) < STEP || t * d_atime_ <= 0.0 ||
(d_atime_ > 0.0 && t < d_atime_ - 1.0) || fabs(t) < fabs(d_atime_)) {
(d_atime_ < 0.0 && t > d_atime_ + 1.0)) {
/* /*
* restart from epoch * restart from epoch
*/ */
@ -1080,6 +1079,7 @@ void SGDP4::DeepSecular(const double& t, double& xll, double& omgasm,
if (!d_synchronous_flag_) if (!d_synchronous_flag_)
xll = xl + temp + temp; xll = xl + temp + temp;
else else
xll = xl - omgasm + temp; xll = xl - omgasm + temp;
} }