Changeset 2556 in ntrip


Ignore:
Timestamp:
Aug 10, 2010, 9:29:33 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
4 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  }
  • trunk/BNC/RTCM3/ephemeris.h

    r2492 r2556  
    104104
    105105 private:
    106   static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
     106  static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
     107                                double* acc);
    107108
    108109  mutable double       _tt;  // time in seconds of GPSweek
  • trunk/BNC/bncutils.cpp

    r2530 r2556  
    255255  const ColumnVector& yi, // vector of the initial y-values
    256256  double dx,              // the step size for the integration
    257   ColumnVector (*der)(double x, const ColumnVector& y)
     257  double* acc,            // aditional acceleration
     258  ColumnVector (*der)(double x, const ColumnVector& y, double* acc)
    258259                          // A pointer to a function that computes the
    259260                          // derivative of a function at a point (x,y)
    260261                         ) {
    261262
    262   ColumnVector k1 = der(xi       , yi       ) * dx;
    263   ColumnVector k2 = der(xi+dx/2.0, yi+k1/2.0) * dx;
    264   ColumnVector k3 = der(xi+dx/2.0, yi+k2/2.0) * dx;
    265   ColumnVector k4 = der(xi+dx    , yi+k3    ) * dx;
     263  ColumnVector k1 = der(xi       , yi       , acc) * dx;
     264  ColumnVector k2 = der(xi+dx/2.0, yi+k1/2.0, acc) * dx;
     265  ColumnVector k3 = der(xi+dx/2.0, yi+k2/2.0, acc) * dx;
     266  ColumnVector k4 = der(xi+dx    , yi+k3    , acc) * dx;
    266267
    267268  ColumnVector yf = yi + k1/6.0 + k2/3.0 + k3/3.0 + k4/6.0;
  • trunk/BNC/bncutils.h

    r2221 r2556  
    5252
    5353ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx,
    54                          ColumnVector (*der)(double x, const ColumnVector& y));
     54                         double* acc,
     55            ColumnVector (*der)(double x, const ColumnVector& y, double* acc));
    5556#endif
Note: See TracChangeset for help on using the changeset viewer.