- Timestamp:
- Aug 10, 2010, 9:37:02 PM (14 years ago)
- Location:
- trunk/BNS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnseph.cpp
r2493 r2558 634 634 // Derivative of the state vector using a simple force model (static) 635 635 //////////////////////////////////////////////////////////////////////////// 636 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv) { 636 ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv, 637 double* acc) { 637 638 638 639 // State vector components … … 646 647 static const double AE = 6378136.0; 647 648 static const double OMEGA = 7292115.e-11; 648 static const double C20 = -1082.6 3e-6;649 static const double C20 = -1082.625e-6; 649 650 650 651 double rho = rr.norm_Frobenius(); … … 661 662 va(2) = vv(2); 662 663 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]; 666 667 667 668 return va; … … 684 685 double step = dtPos / nSteps; 685 686 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; 686 691 for (int ii = 1; ii <= nSteps; ii++) { 687 _xv = rungeKutta4(_tt, _xv, step, glo_deriv);692 _xv = rungeKutta4(_tt, _xv, step, acc, glo_deriv); 688 693 _tt += step; 689 694 } -
trunk/BNS/bnseph.h
r2017 r2558 41 41 virtual int RTCM3(unsigned char *); 42 42 private: 43 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv); 43 static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv, 44 double* acc); 44 45 mutable double _tt; // time in seconds of GPSweek 45 46 mutable ColumnVector _xv; // status vector (position, velocity) at time _tt -
trunk/BNS/bnsutils.cpp
r1687 r2558 128 128 const ColumnVector& yi, // vector of the initial y-values 129 129 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) 131 132 // A pointer to a function that computes the 132 133 // derivative of a function at a point (x,y) 133 134 ) { 134 135 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; 139 140 140 141 ColumnVector yf = yi + k1/6.0 + k2/3.0 + k3/3.0 + k4/6.0; -
trunk/BNS/bnsutils.h
r1197 r2558 31 31 32 32 ColumnVector 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)); 34 35 35 36 QByteArray waitForLine(QTcpSocket* socket);
Note:
See TracChangeset
for help on using the changeset viewer.