WSF
WsfEarthJ2Term.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 2020 Infoscitex, a DCS 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 WSFEARTHJ2TERM_HPP
13#define WSFEARTHJ2TERM_HPP
14
15#include "UtECI_Conversion.hpp"
16#include "UtEarth.hpp"
17#include "UtSphericalEarth.hpp"
19class UtInput;
20
22{
23public:
25 WsfEarthJ2Term(const WsfEarthJ2Term& aOther) = default;
26 ~WsfEarthJ2Term() override = default;
27
28 bool ProcessInput(UtInput& aInput) override;
29
30 WsfEarthJ2Term* Clone() const override { return new WsfEarthJ2Term{*this}; }
31
32 const char* GetScriptClassName() const override { return "WsfEarthJ2Term"; }
33
34 UtVec3d ComputeAcceleration(double aMass,
35 const UtCalendar& aTime,
36 const UtVec3d& aPosition,
37 const UtVec3d& aVelocity) const override;
38
39 std::string GetTermType() const override { return cTYPE; }
40
41 double GetGravitationalParameter() const { return mGravitationalParameter; }
42 void SetGravitationalParameter(double aMu) { mGravitationalParameter = aMu; }
43
44 double GetEarthMeanRadius() const { return mEarthMeanRadius; }
45 void SetEarthMeanRadius(double aMeanRadius) { mEarthMeanRadius = aMeanRadius; }
46
47 double GetJ2() const { return mJ2; }
48 void SetJ2(double aJ2) { mJ2 = aJ2; }
49
50 static constexpr double GetDefaultJ2Value() { return cDEFAULT_J2_VALUE; }
51
52 constexpr static const char* cTYPE{"earth_j2"};
53
54private:
55 void RecomputePrefactor();
56
57 // Vallado, Fundamentals of Astrodynamics and Applications (4th Edition), table inside back cover.
58 constexpr static double cDEFAULT_J2_VALUE{0.0010826267};
59
60 double mGravitationalParameter{UtEarth::cGRAVITATIONAL_PARAMETER};
61 double mEarthMeanRadius{UtSphericalEarth::cEARTH_MEAN_RADIUS};
62 double mJ2{cDEFAULT_J2_VALUE};
63 double mPrefactor{0.0};
64};
65
66#endif // WSFEARTHJ2TERM_HPP
void SetJ2(double aJ2)
Definition WsfEarthJ2Term.hpp:48
static constexpr double GetDefaultJ2Value()
Definition WsfEarthJ2Term.hpp:50
WsfEarthJ2Term(const WsfEarthJ2Term &aOther)=default
UtVec3d ComputeAcceleration(double aMass, const UtCalendar &aTime, const UtVec3d &aPosition, const UtVec3d &aVelocity) const override
Definition WsfEarthJ2Term.cpp:61
void SetEarthMeanRadius(double aMeanRadius)
Definition WsfEarthJ2Term.hpp:45
double GetJ2() const
Definition WsfEarthJ2Term.hpp:47
WsfEarthJ2Term()
Definition WsfEarthJ2Term.cpp:21
void SetGravitationalParameter(double aMu)
Definition WsfEarthJ2Term.hpp:42
double GetGravitationalParameter() const
Definition WsfEarthJ2Term.hpp:41
bool ProcessInput(UtInput &aInput) override
Definition WsfEarthJ2Term.cpp:27
static constexpr const char * cTYPE
Definition WsfEarthJ2Term.hpp:52
double GetEarthMeanRadius() const
Definition WsfEarthJ2Term.hpp:44
const char * GetScriptClassName() const override
Definition WsfEarthJ2Term.hpp:32
~WsfEarthJ2Term() override=default
WsfEarthJ2Term * Clone() const override
Definition WsfEarthJ2Term.hpp:30
std::string GetTermType() const override
Return a string indicating the type of term.
Definition WsfEarthJ2Term.hpp:39
WsfOrbitalDynamicsTerm()
Definition WsfOrbitalDynamicsTerm.hpp:34
Copyrights Multiple, All Rights Reserved