Changeset 2556 in ntrip
- Timestamp:
- Aug 10, 2010, 9:29:33 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/ephemeris.cpp
r2429 r2556 157 157 // Derivative of the state vector using a simple force model (static) 158 158 //////////////////////////////////////////////////////////////////////////// 159 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv) { 159 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv, 160 double* acc) { 160 161 161 162 // State vector components … … 169 170 static const double AE = 6378136.0; 170 171 static const double OMEGA = 7292115.e-11; 171 static const double C20 = -1082.6 3e-6;172 static const double C20 = -1082.625e-6; 172 173 173 174 double rho = rr.norm_Frobenius(); … … 184 185 va(2) = vv(2); 185 186 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]; 189 190 190 191 return va; … … 210 211 double step = dtPos / nSteps; 211 212 213 double acc[3]; 214 acc[0] = _x_acceleration; 215 acc[1] = _x_acceleration; 216 acc[2] = _x_acceleration; 212 217 for (int ii = 1; ii <= nSteps; ii++) { 213 _xv = rungeKutta4(_tt, _xv, step, glo_deriv);218 _xv = rungeKutta4(_tt, _xv, step, acc, glo_deriv); 214 219 _tt += step; 215 220 } -
trunk/BNC/RTCM3/ephemeris.h
r2492 r2556 104 104 105 105 private: 106 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv); 106 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv, 107 double* acc); 107 108 108 109 mutable double _tt; // time in seconds of GPSweek -
trunk/BNC/bncutils.cpp
r2530 r2556 255 255 const ColumnVector& yi, // vector of the initial y-values 256 256 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) 258 259 // A pointer to a function that computes the 259 260 // derivative of a function at a point (x,y) 260 261 ) { 261 262 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; 266 267 267 268 ColumnVector yf = yi + k1/6.0 + k2/3.0 + k3/3.0 + k4/6.0; -
trunk/BNC/bncutils.h
r2221 r2556 52 52 53 53 ColumnVector 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)); 55 56 #endif
Note:
See TracChangeset
for help on using the changeset viewer.