SphericalHarmonicGravity.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SphericalHarmonicGravity.hpp 2457 2010-08-18 14:20:12Z coandrei $"
00002 
00008 #ifndef GPSTK_SPHERICAL_HARMONIC_GRAVITY_HPP
00009 #define GPSTK_SPHERICAL_HARMONIC_GRAVITY_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 
00035 #include "ForceModel.hpp"
00036 #include "EarthSolidTide.hpp"
00037 #include "EarthOceanTide.hpp"
00038 #include "EarthPoleTide.hpp"
00039 
00040 namespace gpstk
00041 {
00042    using namespace StringUtils;
00043 
00046 
00047 
00051    class SphericalHarmonicGravity : public ForceModel
00052    {
00053    public:
00054 
00059       SphericalHarmonicGravity(int n, int m);
00060 
00061 
00063       virtual ~SphericalHarmonicGravity() {};
00064 
00065 
00067       virtual void initialize() = 0;
00068 
00069    
00075       Vector<double> gravity(Vector<double> r, Matrix<double> E);
00076 
00077 
00083       Matrix<double> gravityGradient(Vector<double> r, Matrix<double> E);
00084       
00085 
00092       virtual void doCompute(UTCTime utc, EarthBody& rb, Spacecraft& sc);
00093 
00094 
00095       SphericalHarmonicGravity& setDesiredDegree(const int& n, const int& m)
00096       { desiredDegree = n; desiredOrder = m; return (*this); }
00097 
00098 
00100 
00101       SphericalHarmonicGravity& enableSolidTide(bool b = true)
00102       { correctSolidTide = b; return (*this);}
00103 
00104       SphericalHarmonicGravity& enableOceanTide(bool b = true)
00105       { correctOceanTide = b; return (*this);}
00106       
00107       SphericalHarmonicGravity& enablePoleTide(bool b = true)
00108       { correctPoleTide = b; return (*this);}
00109 
00111       virtual std::string modelName() const
00112       {return "SphericalHarmonicGravity";}
00113 
00115       virtual int forceIndex() const
00116       { return FMI_GEOEARTH; }
00117 
00118 
00119       virtual void test();
00120 
00121    protected:
00122 
00127       void computeVW(Vector<double> r, Matrix<double> E);
00128 
00130       void correctCSTides(UTCTime t,bool solidFlag = false, bool oceanFlag = false, bool poleFlag = false);
00131 
00133       double normFactor(int n, int m);
00134 
00135    protected:
00136 
00137       struct GravityModelData
00138       {
00139          std::string modelName;
00140 
00141          double GM;
00142          double refDistance;
00143 
00144          bool includesPermTide;
00145 
00146          double refMJD;
00147 
00148          double dotC20;
00149          double dotC21;
00150          double dotS21;
00151 
00152          int maxDegree;
00153          int maxOrder;
00154 
00155          Matrix<double> unnormalizedCS;
00156 
00157       } gmData;
00158 
00161       Matrix<double> V, W;
00162 
00164       int desiredDegree, desiredOrder;
00165          
00167       bool   correctSolidTide;
00168       bool   correctPoleTide;
00169       bool   correctOceanTide;
00170 
00172       EarthSolidTide   solidTide;
00173       EarthPoleTide   poleTide;
00174       EarthOceanTide  oceanTide;
00175 
00176 
00177    }; // End of namespace 'gpstk'
00178 
00179       // @}
00180 
00181 }  // End of namespace 'gpstk'
00182 
00183 #endif   // GPSTK_SPHERICAL_HARMONIC_GRAVITY_HPP
00184 
00185 
00186 
00187 

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