- Timestamp:
- May 8, 2008, 11:02:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnseph.cpp
r897 r898 351 351 const static double secPerWeek = 7 * 86400.0; 352 352 353 double dt = GPSweeks - _tt;353 double dtPos = GPSweeks - _tt; 354 354 if (GPSweek != _GPSweek) { 355 dt += (GPSweek - _GPSweek) * secPerWeek;355 dtPos += (GPSweek - _GPSweek) * secPerWeek; 356 356 } 357 357 … … 359 359 << GPSweek << " " << _GPSweek << " " 360 360 << GPSweeks << " " << _GPSweeks << " " << _tt << " " 361 << dt << endl;361 << dtPos << endl; 362 362 363 363 const static double maxStep = 10.0; 364 364 365 365 double tt = 0.0; 366 while ( tt < dt) {367 double step = maxStep;368 if ( tt + step > dt) {369 step = dt - tt;366 while (fabs(tt) < fabs(dtPos)) { 367 double step = dtPos > 0.0 ? maxStep : -maxStep; 368 if (fabs(tt + step) > fabs(dtPos)) { 369 step = dtPos - tt; 370 370 } 371 371 _xv = rungeKutta4(tt, _xv, step, glo_deriv); … … 373 373 } 374 374 375 _tt = GPSweeks; 375 // Next Time Start Integration from Current Epoch 376 // ---------------------------------------------- 377 _tt += dtPos; 376 378 377 379 // Position and Velocity
Note:
See TracChangeset
for help on using the changeset viewer.