Changeset 2556 in ntrip for trunk/BNC/RTCM3/ephemeris.cpp


Ignore:
Timestamp:
Aug 10, 2010, 9:29:33 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/ephemeris.cpp

    r2429 r2556  
    157157// Derivative of the state vector using a simple force model (static)
    158158////////////////////////////////////////////////////////////////////////////
    159 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv) {
     159ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv,
     160                                 double* acc) {
    160161
    161162  // State vector components
     
    169170  static const double AE    = 6378136.0;
    170171  static const double OMEGA = 7292115.e-11;
    171   static const double C20   = -1082.63e-6;
     172  static const double C20   = -1082.625e-6;
    172173
    173174  double rho = rr.norm_Frobenius();
     
    184185  va(2) = vv(2);
    185186  va(3) = vv(3);
    186   va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2);
    187   va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1);
    188   va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3);
     187  va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2) + acc[0];
     188  va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1) + acc[1];
     189  va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3)            + acc[2];
    189190
    190191  return va;
     
    210211  double step = dtPos / nSteps;
    211212
     213  double acc[3];
     214  acc[0] = _x_acceleration;
     215  acc[1] = _x_acceleration;
     216  acc[2] = _x_acceleration;
    212217  for (int ii = 1; ii <= nSteps; ii++) {
    213     _xv = rungeKutta4(_tt, _xv, step, glo_deriv);
     218    _xv = rungeKutta4(_tt, _xv, step, acc, glo_deriv);
    214219    _tt += step;
    215220  }
Note: See TracChangeset for help on using the changeset viewer.