SatOrbit.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SatOrbit.hpp 2535 2011-03-25 15:58:06Z ccutlip $"
00002 
00008 #ifndef GPSTK_SAT_ORBIT_HPP
00009 #define GPSTK_SAT_ORBIT_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 "EquationOfMotion.hpp"
00035 #include "EarthBody.hpp"
00036 #include "Spacecraft.hpp"
00037 #include "ForceModelList.hpp"
00038 
00039 #include "SphericalHarmonicGravity.hpp"
00040 #include "SunForce.hpp"
00041 #include "MoonForce.hpp"
00042 #include "AtmosphericDrag.hpp"
00043 #include "SolarRadiationPressure.hpp"
00044 #include "RelativityEffect.hpp"
00045 
00046 namespace gpstk
00047 {
00048 
00051 
00052   
00056    class SatOrbit : public EquationOfMotion
00057    {
00058    public:
00060       enum GravityModel
00061       {
00062          GM_JGM3,
00063          GM_EGM96
00064       };
00065 
00067       enum AtmosphericModel
00068       {
00069          AM_HarrisPriester,
00070          AM_MSISE00,
00071          AM_CIRA
00072       };
00073 
00075       struct FMCData
00076       {
00077          bool geoEarth;
00078          bool geoSun;
00079          bool geoMoon;
00080          bool atmDrag;
00081          bool relEffect;
00082          bool solarPressure;
00083 
00084          GravityModel grvModel;
00085          int grvDegree;
00086          int grvOrder;
00087 
00088          bool solidTide;
00089          bool oceanTide;
00090          bool poleTide;
00091 
00092          AtmosphericModel atmModel;
00093 
00094          // We'll allocate memory in the heap for some of the models are memory
00095          // consuming
00096          
00097          SphericalHarmonicGravity* pGeoEarth;
00098          
00099          SunForce* pGeoSun;
00100          
00101          MoonForce* pGeoMoon;
00102          
00103          AtmosphericDrag* pAtmDrag;
00104          
00105          SolarRadiationPressure* pSolarPressure;
00106          
00107          RelativityEffect* pRelEffect;
00108 
00109          double dailyF107;
00110          double averageF107;
00111          double dailyKp;
00112 
00113          FMCData()
00114          {
00115             geoEarth = true;
00116             geoSun = geoMoon = false;
00117             atmDrag = false;
00118             relEffect = false;
00119             solarPressure = false;
00120 
00121             grvModel = GM_JGM3;
00122             grvDegree = 1;
00123             grvOrder = 1;
00124 
00125             solidTide = oceanTide = poleTide = false;
00126 
00127             atmModel = AM_HarrisPriester;
00128 
00129             pGeoEarth = NULL;
00130             pGeoSun   = NULL;
00131             pGeoMoon  = NULL;
00132             pAtmDrag  = NULL;
00133             pSolarPressure  = NULL;
00134             pRelEffect      = NULL;
00135 
00136             dailyF107 = 150.0;
00137             averageF107 = 150.0;
00138             dailyKp = 3.0;
00139          }
00140       };
00141 
00142    public:
00143 
00145       SatOrbit() : fmlPrepared(false)
00146       { reset(); }
00147 
00149       virtual ~SatOrbit()
00150       { deleteFMObjects(forceConfig); }
00151 
00152        
00153       virtual Vector<double> getDerivatives(const double&         t,
00154                                             const Vector<double>& y );
00155 
00157       SatOrbit& reset()
00158       {deleteFMObjects(forceConfig);fmlPrepared = false;init();return(*this);}
00159 
00161       SatOrbit& setRefEpoch(UTCTime utc)
00162       { utc0 = utc; return (*this); }
00163 
00165       UTCTime getRefEpoch() const
00166       { return utc0; }
00167 
00168 
00170       SatOrbit& setSpacecraftData(std::string name = "sc-test01",
00171                                   const double& mass = 1000.0,
00172                                   const double& area = 20.0,
00173                                   const double& areaSRP = 20.0,
00174                                   const double& Cr = 1.0,
00175                                   const double& Cd = 2.2);
00176 
00178       SatOrbit& setSpaceData(double dayF107 = 150.0,
00179                              double aveF107 = 150.0, 
00180                              double dayKp = 3.0);
00181       
00182 
00183          // Methods to config the orbit perturbation force models
00184          // call 'reset()' before call these methods
00185 
00186       SatOrbit& enableGeopotential(SatOrbit::GravityModel model = SatOrbit::GM_JGM3,
00187                                    const int& maxDegree = 1,
00188                                    const int& maxOrder = 1,
00189                                    const bool& solidTide = false,
00190                                    const bool& oceanTide = false,
00191                                    const bool& poleTide = false);
00192 
00193       SatOrbit& enableThirdBodyPerturbation(const bool& bsun = false,
00194                                             const bool& bmoon = false);
00195 
00196 
00197       SatOrbit& enableAtmosphericDrag(SatOrbit::AtmosphericModel model 
00198                                                  = SatOrbit::AM_HarrisPriester,
00199                                       const bool& bdrag = false);
00200 
00201 
00202       SatOrbit& enableSolarRadiationPressure(bool bsrp = false);
00203 
00204 
00205       SatOrbit& enableRelativeEffect(const bool& brel = false);
00206 
00207 
00209       void setForceModelType(std::set<ForceModel::ForceModelType> fmt)
00210       { forceList.setForceModelType(fmt); }
00211 
00212 
00213    protected:
00214 
00215       virtual void init();
00216 
00217       void createFMObjects(FMCData& fmc);
00218 
00219       void deleteFMObjects(FMCData& fmc);
00220 
00224       void addForce(ForceModel* pForce)
00225       { forceList.addForce(pForce); }
00226 
00228       UTCTime utc0;
00229       
00231       Spacecraft sc;
00232 
00234       EarthBody  earthBody;     
00235 
00237       FMCData forceConfig;
00238   
00241       bool fmlPrepared;
00242 
00244       ForceModelList forceList;
00245 
00246          // Objected
00247 
00248    }; // End of class 'SatOrbit'
00249 
00250 }  // End of namespace 'gpstk'
00251 
00252 #endif   // GPSTK_SAT_ORBIT_HPP
00253 
00254 
00255 

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