Updated solving keplers equation

feature/19
Daniel Warner 2011-03-27 13:18:55 +01:00
parent 51eb52a801
commit 3c9eb74680
1 changed files with 14 additions and 0 deletions

View File

@ -291,6 +291,11 @@ void SGDP4::FindPosition(double tsince) {
double ecose = 0.0;
double esine = 0.0;
/*
* todo
*/
double maxnr = Eccentricity();
bool kepler_running = true;
for (int i = 0; i < 10 && kepler_running; i++) {
@ -310,6 +315,15 @@ void SGDP4::FindPosition(double tsince) {
double df = 1.0 - ecose;
double nr = f / df;
/*
* 2nd order Newton-Raphson correction.
* f / (df - 0.5 * d2f * f/df)
*/
if (i == 0 && fabs(nr) > 1.25 * maxnr)
nr = fabs(maxnr, nr);
else
nr = f / (df + 0.5 * esine * nr);
/*
* Newton-Raphson correction of -F/DF
*/