GLOCNavAlmUncorrected.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 
26 //==============================================================================
27 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
39 #ifndef GNSSTK_GLOCNAVALMUNCORRECTED_CPP
40 #define GNSSTK_GLOCNAVALMUNCORRECTED_CPP
41 
45 #include "DebugTrace.hpp"
46 
47 namespace gnsstk
48 {
49  inline void GLOCNavAlm::Uncorrected ::
50  setData(const GLOCNavAlm& alm, double Tdr, double n, double Deltatpr)
51  {
52  seti(alm.deltai);
53  seta(alm.ecc, alm.omega, Tdr);
54  setp(alm.ecc);
55  setlambda(alm.lambda, n, Deltatpr);
56  setomega(alm.omega, n, Deltatpr);
57  sethl(alm.ecc);
58  }
59 
60 
61  inline void GLOCNavAlm::Uncorrected ::
62  seti(double DeltaiA)
63  {
64  i = ((iav / 180.0) + DeltaiA) * gnsstk::PI;
65  }
66 
67 
68  inline void GLOCNavAlm::Uncorrected ::
69  seta(double epsilonA, double omegaA, double Tdr)
70  {
71  // approximate semi-major axis
72  double Tosc = Tdr;
73  double am = -9, am1 = 9, pm1 = 0;
74  double ecc2obv = (1.0 - (epsilonA*epsilonA));
75  double ecc2obvTH = sqrt(ecc2obv*ecc2obv*ecc2obv);
76  unsigned m = 0;
77  // 1e-5 = 1cm in km, as specified in ICD
78  while (fabs(am1-am) > 1e-5)
79  {
80  double f1 = Tosc / (2.0 * gnsstk::PI);
81  am = am1;
82  am1 = std::cbrt(f1 * f1 * GM);
83  pm1 = am1 * ecc2obv;
84  double top1 = 1 + (epsilonA * cos(omegaA * gnsstk::PI));
85  double term1 = top1 * top1 * top1 / ecc2obv;
86  double term2 = ecc2obvTH / (top1 * top1);
87  double term3 = 2.0 - ((5.0/2.0) * sin(i)*sin(i));
88  double term321 = (term3*term2) + term1;
89  double term4a = ae / pm1;
90  double term4 = (3.0/2.0) * J20 * term4a * term4a;
91  double term4321 = term4 * term321;
92  Tosc = Tdr / (1.0-term4321);
93  // DEBUGTRACE(std::setw(1) << m << " | " << std::setw(18)
94  // << std::setprecision(12) << std::fixed << am1 << " | "
95  // << pm1 << " | " << Tosc);
96  m++;
97  }
98  Perturbations::a = am1;
99  }
100 
101 
102  inline void GLOCNavAlm::Uncorrected ::
103  setp(double epsilonA)
104  {
105  p = a * (1.0 - epsilonA*epsilonA);
106  }
107 
108 
109  inline void GLOCNavAlm::Uncorrected ::
110  sethl(double epsilonA)
111  {
112  h = epsilonA * sin(omega);
113  l = epsilonA * cos(omega);
114  }
115 
116 
117  inline void GLOCNavAlm::Uncorrected ::
118  setlambda(double lambdaA, double n, double Deltatpr)
119  {
120  double ev = ae / p;
121  double lambdaTerm = ell.angVelocity() + (3.0/2.0)*J20*n*ev*ev*cos(i);
122  Perturbations::lambda = (lambdaA * gnsstk::PI) - (lambdaTerm * Deltatpr);
123  // DEBUGTRACE("lambda ae = " << std::scientific << ae);
124  // DEBUGTRACE("lambda p = " << std::scientific << p);
125  // DEBUGTRACE("lambda ev = " << std::scientific << ev);
126  // DEBUGTRACE("lambda_term = " << std::scientific << lambdaTerm);
127  // DEBUGTRACE("lambda = " << lambda);
128  }
129 
130 
131  inline void GLOCNavAlm::Uncorrected ::
132  setomega(double omegaA, double n, double Deltatpr)
133  {
134  double ev = ae / p;
135  double omegaTerm = (3.0/4.0)*J20*n*ev*ev*(1.0-(5.0*cos(i)*cos(i)));
136  Perturbations::omega = (omegaA * gnsstk::PI) - (omegaTerm * Deltatpr);
137  }
138 } // namespace gnsstk
139 
140 #endif //GNSSTK_GLOCNAVALMUNCORRECTED_CPP
141 
gnsstk::GLOCNavAlm::GM
static const GNSSTK_EXPORT double GM
Gravitational constant.
Definition: GLOCNavAlm.hpp:67
gnsstk::GLOCNavAlm::ae
static const GNSSTK_EXPORT double ae
Equatorial radius of Earth in km.
Definition: GLOCNavAlm.hpp:69
gnsstk::GLOCNavAlm::Perturbations::lambda
double lambda
longitude of ascending node
Definition: GLOCNavAlm.hpp:167
gnsstk::GLOCNavAlm::Uncorrected::seta
void seta(double epsilonA, double omegaA, double Tdr)
Definition: GLOCNavAlmUncorrected.hpp:69
gnsstk::GLOCNavAlm::iav
static const GNSSTK_EXPORT double iav
iap</cp> as defined in ICD-GLONASS-CDMA-L3 section 5.3.2.12
Definition: GLOCNavAlm.hpp:73
gnsstk::PZ90Ellipsoid::angVelocity
virtual double angVelocity() const noexcept
Definition: PZ90Ellipsoid.hpp:97
gnsstk::GLOCNavAlm::J20
static const GNSSTK_EXPORT double J20
Second degree coefficient of normal potential, table 4.1.
Definition: GLOCNavAlm.hpp:77
gnsstk::PI
const double PI
GPS value of PI; also specified by GAL.
Definition: GNSSconstants.hpp:62
gnsstk::GLOCNavAlm::Perturbations::omega
double omega
argument of perigee
Definition: GLOCNavAlm.hpp:168
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
std::sin
double sin(gnsstk::Angle x)
Definition: Angle.hpp:144
gnsstk::GLOCNavAlm::Uncorrected::sethl
void sethl(double epsilonA)
Definition: GLOCNavAlmUncorrected.hpp:110
gnsstk::GLOCNavAlm::deltai
double deltai
Inclination offset from 64.8 degrees (semicirc).
Definition: GLOCNavAlm.hpp:139
gnsstk::GLOCNavAlm
Definition: GLOCNavAlm.hpp:61
gnsstk::GLOCNavAlm::ell
static const GNSSTK_EXPORT PZ90Ellipsoid ell
Ellipsoid parameters used by GLONASS.
Definition: GLOCNavAlm.hpp:65
gnsstk::GLOCNavAlm::Uncorrected::setlambda
void setlambda(double lambdaA, double n, double Deltatpr)
Definition: GLOCNavAlmUncorrected.hpp:118
gnsstk::GLOCNavAlm::ecc
double ecc
Eccentricity at tlambdaA.
Definition: GLOCNavAlm.hpp:140
gnsstk::GLOCNavAlm::Uncorrected::setData
void setData(const GLOCNavAlm &alm, double Tdr, double n, double Deltatpr)
Definition: GLOCNavAlmUncorrected.hpp:50
gnsstk::GLOCNavAlm::Uncorrected::setomega
void setomega(double omegaA, double n, double Deltatpr)
Definition: GLOCNavAlmUncorrected.hpp:132
std::cos
double cos(gnsstk::Angle x)
Definition: Angle.hpp:146
gnsstk::GLOCNavAlm::Perturbations::a
double a
Semi-major axis.
Definition: GLOCNavAlm.hpp:164
DebugTrace.hpp
gnsstk::GLOCNavAlm::omega
double omega
Almanac parameter for argument of perigee (semicirc).
Definition: GLOCNavAlm.hpp:141
gnsstk::GLOCNavAlm::lambda
double lambda
Longitude of first ascending node (semicirc).
Definition: GLOCNavAlm.hpp:137
gnsstk::GLOCNavAlm::Uncorrected::seti
void seti(double DeltaiA)
Definition: GLOCNavAlmUncorrected.hpp:62
gnsstk::GLOCNavAlm::Uncorrected::setp
void setp(double epsilonA)
Definition: GLOCNavAlmUncorrected.hpp:103


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39