WSF
WsfNORAD_Util.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFNORAD_UTIL_HPP
13#define WSFNORAD_UTIL_HPP
14
15#include "UtTwoLineElement.hpp"
16
17//(mjm) not using the "Retain Perturbation Values" #ifdef
18//#defines moved to WsfNORAD_SpaceMover.hpp as const ints
19// in an anonymous namespace.
20
21// if we're retaining the perturbation values at the
22// epoch, it'll cost us another five doubles and an integer.
23//#ifdef RETAIN_PERTURBATION_VALUES_AT_EPOCH
24//#define DEEP_ARG_T_PARAMS 93
25//#else
26//#define DEEP_ARG_T_PARAMS 87
27//#endif
28
29//#define N_SGP_PARAMS 11
30//#define N_SGP4_PARAMS 29
31//#define N_SGP8_PARAMS 25
32//#define N_SDP4_PARAMS (9 + DEEP_ARG_T_PARAMS)
33//#define N_SDP8_PARAMS (11 + DEEP_ARG_T_PARAMS)
34
35// 87 or 93 = size of the 'deep_arg_t' structure, in 8-byte units
36// You can use the above constants to minimize the amount of memory used,
37// but if you use the following constant, you can be assured of having
38// enough memory for any of the five models:
39
40//#define N_SAT_PARAMS (11 + DEEP_ARG_T_PARAMS)
41// static const int N_SAT_PARAMS = (11 + DEEP_ARG_T_PARAMS);
42
43// Common "internal" arguments between deep-space functions; users of
44// the satellite routines shouldn't need to bother with any of this
45
50
51namespace WsfNORAD_Util // included for documentation purposes.
52{
55class tle_t
56{
57public:
58 explicit tle_t(const UtTwoLineElement& aTLE)
59 : epoch(aTLE.GetEpochDate())
60 , xndt2o(aTLE.GetMeanMotionFirstDerivative())
61 , xndd6o(aTLE.GetMeanMotionSecondDerivative())
62 , bstar(aTLE.GetBstarDrag())
63 , xincl(aTLE.GetInclination())
64 , xnodeo(aTLE.GetRAAN())
65 , eo(aTLE.GetEccentricity())
66 , omegao(aTLE.GetArgumentOfPeriapsis())
67 , xmo(aTLE.GetMeanAnomaly())
68 , xno(aTLE.GetMeanMotion())
69 {
70 xno *= 60.0; // rad / min
71 }
72
73 ~tle_t() {}
74
75 double epoch;
77 double xndt2o;
78 double xndd6o;
79 double bstar;
80 double xincl;
81 double xnodeo;
82 double eo;
83 double omegao;
84 double xmo;
85 double xno;
86
87private:
88 tle_t();
89};
90
91typedef struct
92{
93 double
94 // Common between SGP4 and SDP4:
97 // Used by dpinit part of Deep()
99
100 // Used by dpsec and dpper parts of Deep()
102
103 // 'd####' secular coeffs for 12-hour, e>.5 orbits:
105
106 // formerly static to Deep( ), but more logically part of this struct:
110
111 // Epoch offsets, described by Rob Matson, added by BJG,
112 // then commented out; I don't think they really ought to
113 // be used...
114 //#ifdef RETAIN_PERTURBATION_VALUES_AT_EPOCH
115 // double pe0, pinc0, pl0, pgh0, ph0;
116 // int solar_lunar_init_flag;
117 //#endif
118
120
121} deep_arg_t;
122
123double FMod2p(const double x);
124
125void Deep_dpinit(const tle_t* tle, deep_arg_t* deep_arg);
126
127void Deep_dpsec(const tle_t* tle, deep_arg_t* deep_arg);
128
130
131void sxpx_posn_vel(const double xnode,
132 const double a,
133 const double e,
134 const double* params,
135 const double cosio,
136 const double sinio,
137 const double xincl,
138 const double omega,
139 const double xl,
140 double* pos,
141 double* vel);
142
143typedef struct
144{
145 double coef;
146 double coef1;
147 double tsi;
148 double s4;
149 double a3ovk2;
150 double eta;
151} init_t;
152
153void sxpx_common_init(double* params, const tle_t* tle, init_t* init, deep_arg_t* deep_arg);
154
155// Table of constant values
156//#define de2ra (pi/180.)
157//#define pi 3.141592653589793238462643383279502884197
158//#define pio2 (pi/2.)
159//#define x3pio2 (pi*1.5)
160//#define twopi (pi*2.)
161
162const double e6a = 1.0E-6;
163const double two_thirds = (2. / 3.);
164const double xj3 = -2.53881E-6;
165const double xkmper = 6.378135E3;
166const double xmnpda = 1440.;
167const double ae = 1.0;
168const double ck2 = 5.413079E-4;
169
170//#ifdef OLD_CONSTANTS
171//#define ck4 6.209887E-7
172//#define s 1.012229
173//#define qoms2t 1.880279E-09
174//#define xke 7.43669161E-2
175//#else
176const double ck4 = 6.2098875E-7;
177const double s = 1.0122292801892716;
178const double qoms2t = 1.8802791590152709e-9;
179const double xke = 0.074366916133173408;
180//#endif
181
182//#define secday 86400.
183const double rho = 1.5696615E-1;
184} // namespace WsfNORAD_Util
185
186#endif
#define deep_arg
Definition WsfNORAD_OrbitalPropagator.cpp:584
UtVec3d pos
Definition WsfScriptTrackClass.cpp:1881
UtVec3d vel
Definition WsfScriptTrackClass.cpp:1881
Definition WsfNORAD_Util.hpp:56
double bstar
2nd time derivative of mean motion
Definition WsfNORAD_Util.hpp:79
double eo
right ascension of the ascending node (RAAN)
Definition WsfNORAD_Util.hpp:82
double xndt2o
Definition WsfNORAD_Util.hpp:77
double epoch
Definition WsfNORAD_Util.hpp:75
double xndd6o
1st time derivative of mean motion
Definition WsfNORAD_Util.hpp:78
~tle_t()
Definition WsfNORAD_Util.hpp:73
double omegao
eccentricity
Definition WsfNORAD_Util.hpp:83
tle_t(const UtTwoLineElement &aTLE)
Definition WsfNORAD_Util.hpp:58
double xnodeo
inclination
Definition WsfNORAD_Util.hpp:81
double xincl
"bstar" drag term
Definition WsfNORAD_Util.hpp:80
double xmo
argument of the periapsis
Definition WsfNORAD_Util.hpp:84
double xno
mean anomaly
Definition WsfNORAD_Util.hpp:85
A set of common "utility" structure definitions and functions for the WsfNORAD_SpaceMover class.
Definition WsfNORAD_Util.cpp:24
const double ck2
Definition WsfNORAD_Util.hpp:168
void sxpx_posn_vel(const double xnode, const double a, const double e, const double *params, const double cosio, const double sinio, const double xincl, const double omega, const double xl, double *pos, double *vel)
Definition WsfNORAD_Util.cpp:132
const double rho
Definition WsfNORAD_Util.hpp:183
const double e6a
Definition WsfNORAD_Util.hpp:162
const double ck4
Definition WsfNORAD_Util.hpp:176
const double xkmper
Definition WsfNORAD_Util.hpp:165
const double s
Definition WsfNORAD_Util.hpp:177
const double xmnpda
Definition WsfNORAD_Util.hpp:166
const double xke
Definition WsfNORAD_Util.hpp:179
void Deep_dpsec(const tle_t *tle, deep_arg_t *deep_arg)
Definition WsfNORAD_Util.cpp:611
const double xj3
Definition WsfNORAD_Util.hpp:164
const double qoms2t
Definition WsfNORAD_Util.hpp:178
void sxpx_common_init(double *params, const tle_t *tle, init_t *init, deep_arg_t *deep_arg)
Definition WsfNORAD_Util.cpp:49
const double ae
Definition WsfNORAD_Util.hpp:167
void Deep_dpper(deep_arg_t *deep_arg)
Definition WsfNORAD_Util.cpp:761
double FMod2p(const double x)
FMod2p takes an angle and returns the modulo by 2*pi of that angle.
Definition WsfNORAD_Util.cpp:28
void Deep_dpinit(const tle_t *tle, deep_arg_t *deep_arg)
Definition WsfNORAD_Util.cpp:294
const double two_thirds
Definition WsfNORAD_Util.hpp:163
Definition WsfNORAD_Util.hpp:92
double d5220
Definition WsfNORAD_Util.hpp:104
double pinc
Definition WsfNORAD_Util.hpp:107
int resonance_flag
Definition WsfNORAD_Util.hpp:119
double d5433
Definition WsfNORAD_Util.hpp:104
double xi3
Definition WsfNORAD_Util.hpp:108
double del3
Definition WsfNORAD_Util.hpp:107
double del1
Definition WsfNORAD_Util.hpp:107
double sing
Definition WsfNORAD_Util.hpp:98
double betao
Definition WsfNORAD_Util.hpp:98
double sgh2
Definition WsfNORAD_Util.hpp:107
double xll
Definition WsfNORAD_Util.hpp:101
double savtsn
Definition WsfNORAD_Util.hpp:107
double xnq
Definition WsfNORAD_Util.hpp:109
double d5421
Definition WsfNORAD_Util.hpp:104
double d3210
Definition WsfNORAD_Util.hpp:104
double d2211
Definition WsfNORAD_Util.hpp:104
double sh2
Definition WsfNORAD_Util.hpp:107
double zsinil
Definition WsfNORAD_Util.hpp:109
double xnodot
Definition WsfNORAD_Util.hpp:96
double xinc
Definition WsfNORAD_Util.hpp:101
double si2
Definition WsfNORAD_Util.hpp:108
double d5232
Definition WsfNORAD_Util.hpp:104
double atime
Definition WsfNORAD_Util.hpp:107
double xh2
Definition WsfNORAD_Util.hpp:108
double se3
Definition WsfNORAD_Util.hpp:107
double em
Definition WsfNORAD_Util.hpp:101
double theta2
Definition WsfNORAD_Util.hpp:98
double xl2
Definition WsfNORAD_Util.hpp:108
double omgdot
Definition WsfNORAD_Util.hpp:96
double xn
Definition WsfNORAD_Util.hpp:101
double thgr
Definition WsfNORAD_Util.hpp:108
double aodp
Definition WsfNORAD_Util.hpp:95
double se2
Definition WsfNORAD_Util.hpp:107
double cosg
Definition WsfNORAD_Util.hpp:98
double d4422
Definition WsfNORAD_Util.hpp:104
double sh3
Definition WsfNORAD_Util.hpp:108
double zcosil
Definition WsfNORAD_Util.hpp:109
double pe
Definition WsfNORAD_Util.hpp:107
double ssh
Definition WsfNORAD_Util.hpp:108
double sinio
Definition WsfNORAD_Util.hpp:96
double pl
Definition WsfNORAD_Util.hpp:107
double ssi
Definition WsfNORAD_Util.hpp:108
double ph
Definition WsfNORAD_Util.hpp:107
double xl3
Definition WsfNORAD_Util.hpp:109
double sl2
Definition WsfNORAD_Util.hpp:108
double si3
Definition WsfNORAD_Util.hpp:108
double e3
Definition WsfNORAD_Util.hpp:107
double zmos
Definition WsfNORAD_Util.hpp:109
double sgh3
Definition WsfNORAD_Util.hpp:107
double zsinhl
Definition WsfNORAD_Util.hpp:109
double xgh4
Definition WsfNORAD_Util.hpp:108
double omgadf
Definition WsfNORAD_Util.hpp:101
double xnode
Definition WsfNORAD_Util.hpp:101
double omegaq
Definition WsfNORAD_Util.hpp:107
double sgh4
Definition WsfNORAD_Util.hpp:107
double xni
Definition WsfNORAD_Util.hpp:109
double del2
Definition WsfNORAD_Util.hpp:107
double ee2
Definition WsfNORAD_Util.hpp:107
double betao2
Definition WsfNORAD_Util.hpp:98
double sl4
Definition WsfNORAD_Util.hpp:108
double zcoshl
Definition WsfNORAD_Util.hpp:109
double zcosgl
Definition WsfNORAD_Util.hpp:109
double xgh3
Definition WsfNORAD_Util.hpp:108
double xfact
Definition WsfNORAD_Util.hpp:108
double sse
Definition WsfNORAD_Util.hpp:108
double xmdot
Definition WsfNORAD_Util.hpp:96
double xlamo
Definition WsfNORAD_Util.hpp:109
double zsingl
Definition WsfNORAD_Util.hpp:109
double pgh
Definition WsfNORAD_Util.hpp:107
double zmol
Definition WsfNORAD_Util.hpp:109
double sl3
Definition WsfNORAD_Util.hpp:108
double preep
Definition WsfNORAD_Util.hpp:107
double t
Definition WsfNORAD_Util.hpp:101
double xi2
Definition WsfNORAD_Util.hpp:108
double xli
Definition WsfNORAD_Util.hpp:109
double xqncl
Definition WsfNORAD_Util.hpp:109
double ssg
Definition WsfNORAD_Util.hpp:108
int synchronous_flag
Definition WsfNORAD_Util.hpp:119
double cosio
Definition WsfNORAD_Util.hpp:96
double xgh2
Definition WsfNORAD_Util.hpp:108
double eosq
Definition WsfNORAD_Util.hpp:98
double xh3
Definition WsfNORAD_Util.hpp:108
double ssl
Definition WsfNORAD_Util.hpp:108
double xl4
Definition WsfNORAD_Util.hpp:109
double xnodp
Definition WsfNORAD_Util.hpp:96
double d2201
Definition WsfNORAD_Util.hpp:104
double d4410
Definition WsfNORAD_Util.hpp:104
double d3222
Definition WsfNORAD_Util.hpp:104
Definition WsfNORAD_Util.hpp:144
double coef
Definition WsfNORAD_Util.hpp:145
double a3ovk2
Definition WsfNORAD_Util.hpp:149
double s4
Definition WsfNORAD_Util.hpp:148
double eta
Definition WsfNORAD_Util.hpp:150
double coef1
Definition WsfNORAD_Util.hpp:146
double tsi
Definition WsfNORAD_Util.hpp:147
Copyrights Multiple, All Rights Reserved