Changeset 2558 in ntrip for trunk/BNS/bnseph.cpp


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

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnseph.cpp

    r2493 r2558  
    634634// Derivative of the state vector using a simple force model (static)
    635635////////////////////////////////////////////////////////////////////////////
    636 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv) {
     636ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv,
     637                                 double* acc) {
    637638
    638639  // State vector components
     
    646647  static const double AE    = 6378136.0;
    647648  static const double OMEGA = 7292115.e-11;
    648   static const double C20   = -1082.63e-6;
     649  static const double C20   = -1082.625e-6;
    649650
    650651  double rho = rr.norm_Frobenius();
     
    661662  va(2) = vv(2);
    662663  va(3) = vv(3);
    663   va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2);
    664   va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1);
    665   va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3);
     664  va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2) + acc[0];
     665  va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1) + acc[1];
     666  va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3)            + acc[2];
    666667
    667668  return va;
     
    684685  double step = dtPos / nSteps;
    685686
     687  double acc[3];
     688  acc[0] = _x_acceleration * 1.e3;
     689  acc[1] = _x_acceleration * 1.e3;
     690  acc[2] = _x_acceleration * 1.e3;
    686691  for (int ii = 1; ii <= nSteps; ii++) {
    687     _xv = rungeKutta4(_tt, _xv, step, glo_deriv);
     692    _xv = rungeKutta4(_tt, _xv, step, acc, glo_deriv);
    688693    _tt += step;
    689694  }
Note: See TracChangeset for help on using the changeset viewer.