SatOrbitPropagator.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SatOrbitPropagator.hpp 2457 2010-08-18 14:20:12Z coandrei $"
00002 
00008 #ifndef GPSTK_SAT_ORBIT_PROPAGATOR_HPP
00009 #define GPSTK_SAT_ORBIT_PROPAGATOR_HPP
00010 
00011 
00012 //============================================================================
00013 //
00014 //  This file is part of GPSTk, the GPS Toolkit.
00015 //
00016 //  The GPSTk is free software; you can redistribute it and/or modify
00017 //  it under the terms of the GNU Lesser General Public License as published
00018 //  by the Free Software Foundation; either version 2.1 of the License, or
00019 //  any later version.
00020 //
00021 //  The GPSTk is distributed in the hope that it will be useful,
00022 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 //  GNU Lesser General Public License for more details.
00025 //
00026 //  You should have received a copy of the GNU Lesser General Public
00027 //  License along with GPSTk; if not, write to the Free Software Foundation,
00028 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00029 //
00030 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010
00031 //
00032 //============================================================================
00033 
00034 #include <iostream>
00035 #include <string>
00036 
00037 #include "Integrator.hpp"
00038 #include "RungeKuttaFehlberg.hpp"
00039 #include "SatOrbit.hpp"
00040 
00041 
00042 namespace gpstk
00043 {
00046 
00087    class SatOrbitPropagator
00088    {
00089    public:
00090 
00092       SatOrbitPropagator();
00093 
00095       virtual ~SatOrbitPropagator();
00096 
00097       /* set force model setting
00098       */
00099       //void setForceModel(ForceModelSetting& fms);
00100    
00101 
00103       SatOrbitPropagator& setIntegrator(Integrator* pIntg)
00104       { pIntegrator = pIntg; return (*this); }
00105 
00106 
00108       SatOrbitPropagator& setDefaultIntegrator()
00109       { pIntegrator = &rkfIntegrator; return (*this); }
00110 
00112       SatOrbitPropagator& setOrbit(SatOrbit* porbit)
00113       { pOrbit = porbit; return (*this); }
00114       
00115 
00117       SatOrbitPropagator& setDefaultOrbit()
00118       { pOrbit = &defaultOrbit; return (*this); }
00119 
00120 
00122       SatOrbitPropagator& setStepSize(double step_size = 10.0)
00123       { pIntegrator->setStepSize(step_size); return (*this); }
00124 
00130       SatOrbitPropagator& setInitState(UTCTime utc0, Vector<double> rv0);
00131       
00132 
00137       virtual bool integrateTo(double tf);
00138 
00139 
00141       Vector<double> rvState(bool bJ2k = true);
00142 
00144       Matrix<double> transitionMatrix()
00145       { return phiMatrix; }
00146 
00148       Matrix<double> sensitivityMatrix()
00149       { return sMatrix; }
00150 
00152       UTCTime getCurTime()
00153       { UTCTime utc = pOrbit->getRefEpoch(); utc += curT; return utc;}
00154 
00156       Vector<double> getCurState()
00157       { return curState;}
00158 
00160       int getNP()
00161       { return (curState.size() - 42) / 6; }
00162 
00164       SatOrbit* getSatOrbitPointer()
00165       { return pOrbit; }
00166 
00168       void writeToFile(ostream& s);
00169 
00170       /*
00171       * try to integrate ephemeris and print it to a file
00172       * just for compare it with stk8.1
00173       * 
00174       * yanwei,Sep 19 th,2009
00175       */
00176       //void makeSatEph(OrbitSetting& os,string fileName);
00177       //void makeRefSatEph(OrbitSetting& os,string fileName);
00178 
00179       /* For Testing and Debuging...
00180       */
00181       void test();
00182 
00183    protected:
00184 
00192       virtual Vector<double> integrateTo(double t, Vector<double> y, double tf);
00193 
00194       /* set initial state of the the integrator
00195       *
00196       *  v      3
00197       * dr_dr0    3*3
00198       * dr_dv0   3*3
00199       * dr_dp0   3*np
00200       * dv_dr0   3*3
00201       * dv_dv0   3*3
00202       * dv_dp0   3*np
00203       */
00204       void setState(Vector<double> state);
00205 
00207       void setRefEpoch(UTCTime utc)
00208       { pOrbit->setRefEpoch(utc); }
00209 
00211       void updateMatrix();
00212 
00214       Integrator*   pIntegrator;
00215 
00217       SatOrbit*   pOrbit;
00218 
00219    private:
00220 
00222       RungeKuttaFehlberg rkfIntegrator;
00223 
00225       SatOrbit   defaultOrbit;
00226             
00228       double curT;         
00229 
00231          // r        3
00232          // v        3
00233          // dr_dr0   3*3
00234          // dr_dv0   3*3
00235          // dr_dp0   3*np
00236          // dv_dr0   3*3
00237          // dv_dv0   3*3
00238          // dv_dp0   3*np
00239       Vector<double> curState;         // 42+6*np
00240       
00242       Vector<double>   rvVector;      // 6
00243 
00245       Matrix<double> phiMatrix;      // 6*6
00246       
00248       Matrix<double> sMatrix;         // 6*np
00249       
00250 
00251       std::set<ForceModel::ForceModelType> setFMT;
00252 
00253    }; // End of class 'SatOrbitPropagator'
00254    
00255 
00262    ostream& operator<<(ostream& s, SatOrbitPropagator& op);
00263 
00264       // @}
00265 
00266 } // end namespace 'gpstk'
00267 
00268 
00269 #endif   // GPSTK_SAT_ORBIT_PROPAGATOR_HPP
00270 
00271 
00272 
00273 
00274 
00275 

Generated on Tue May 22 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1