Changeset 2558 in ntrip for trunk/BNS


Ignore:
Timestamp:
Aug 10, 2010, 9:37:02 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNS
Files:
4 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  }
  • trunk/BNS/bnseph.h

    r2017 r2558  
    4141  virtual int  RTCM3(unsigned char *);
    4242 private:
    43   static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
     43  static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv,
     44                                double* acc);
    4445  mutable double       _tt;  // time in seconds of GPSweek
    4546  mutable ColumnVector _xv;  // status vector (position, velocity) at time _tt
  • trunk/BNS/bnsutils.cpp

    r1687 r2558  
    128128  const ColumnVector& yi, // vector of the initial y-values
    129129  double dx,              // the step size for the integration
    130   ColumnVector (*der)(double x, const ColumnVector& y)
     130  double* acc,            // aditional acceleration
     131  ColumnVector (*der)(double x, const ColumnVector& y, double* acc)
    131132                          // A pointer to a function that computes the
    132133                          // derivative of a function at a point (x,y)
    133134                         ) {
    134135
    135   ColumnVector k1 = der(xi       , yi       ) * dx;
    136   ColumnVector k2 = der(xi+dx/2.0, yi+k1/2.0) * dx;
    137   ColumnVector k3 = der(xi+dx/2.0, yi+k2/2.0) * dx;
    138   ColumnVector k4 = der(xi+dx    , yi+k3    ) * dx;
     136  ColumnVector k1 = der(xi       , yi       , acc) * dx;
     137  ColumnVector k2 = der(xi+dx/2.0, yi+k1/2.0, acc) * dx;
     138  ColumnVector k3 = der(xi+dx/2.0, yi+k2/2.0, acc) * dx;
     139  ColumnVector k4 = der(xi+dx    , yi+k3    , acc) * dx;
    139140
    140141  ColumnVector yf = yi + k1/6.0 + k2/3.0 + k3/3.0 + k4/6.0;
  • trunk/BNS/bnsutils.h

    r1197 r2558  
    3131
    3232ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx,
    33                          ColumnVector (*der)(double x, const ColumnVector& y));
     33                         double* acc,
     34           ColumnVector (*der)(double x, const ColumnVector& y, double* acc));
    3435
    3536QByteArray waitForLine(QTcpSocket* socket);
Note: See TracChangeset for help on using the changeset viewer.