🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
StateKeplerian.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstCore/State.hpp"
25#include "AstCore/OrbitElement.hpp"
26#include "AstCore/TimePoint.hpp"
27
28AST_NAMESPACE_BEGIN
29
34class StateKeplerian;
35using PStateKeplerian = StateKeplerian*;
36using HStateKeplerian = SharedPtr<StateKeplerian>;
37
38
40enum class ESizeType
41{
42 eSMA,
43 eApoAlt,
44 eApoRad,
45 ePeriAlt,
46 ePeriRad,
47 ePeriod,
49};
50
52enum class EShapeType
53{
54 eEcc,
55 eApoAlt,
56 eApoRad,
57 ePeriAlt,
58 ePeriRad,
59};
60
63{
64 eRAAN,
65 eLAN,
66};
67
80
81
82
83
85class AST_CORE_API StateKeplerian final: public State
86{
87public:
88 AST_OBJECT(StateKeplerian)
89 AST_PROPERT(SMA)
90 AST_PROPERT(Period)
91 AST_PROPERT(MeanMotion)
92 AST_PROPERT(ApoRadForSize)
93 AST_PROPERT(ApoAltForSize)
94 AST_PROPERT(PeriRadForSize)
95 AST_PROPERT(PeriAltForSize)
96 AST_PROPERT(Ecc)
97 AST_PROPERT(ApoRadForShape)
98 AST_PROPERT(ApoAltForShape)
99 AST_PROPERT(PeriRadForShape)
100 AST_PROPERT(PeriAltForShape)
101 AST_PROPERT(Inc)
102 AST_PROPERT(RAAN)
103 AST_PROPERT(LAN)
104 AST_PROPERT(ArgPeri)
105 AST_PROPERT(TrueAnomaly)
106 AST_PROPERT(MeanAnomaly)
107 AST_PROPERT(EccAnomaly)
108 AST_PROPERT(ArgLat)
109 AST_PROPERT(TimePastPeri)
110 AST_PROPERT(TimePastAscNode)
111 static PStateKeplerian New();
113 static PStateKeplerian New(const ModOrbElem& modOrbElem);
114 static HStateKeplerian MakeShared(const ModOrbElem& modOrbElem);
115 static PStateKeplerian NewDefault();
116
118 StateKeplerian(const ModOrbElem& modOrbElem);
119 StateKeplerian(const State& state);
120 ~StateKeplerian() override = default;
121public:
122 EStateType getStateType() const override { return EStateType::eKeplerian; }
123 errc_t getState(CartState& state) const override;
124 errc_t setState(const CartState& state) override;
125public:
126 void setState(OrbElem& orbElem);
127 void getState(OrbElem& orbElem) const;
128 errc_t setState(const ModOrbElem& modOrbElem) override { modOrbElem_ = modOrbElem; return eNoError; }
129 errc_t getState(ModOrbElem& modOrbElem) const override { modOrbElem = modOrbElem_; return eNoError; }
130public:
132 void getInnerRepresentationState(array6d& stateInRepresentation) const;
134 void getStateInRepresentation(
135 ESizeType sizeType, EShapeType shapeType,
136 EOrientationType orientationType, EPositionType positionType,
137 array6d& stateInRepresentation
138 ) const;
139 double getStateParam(int index);
140 void setStateParam(int index, double value);
142 double getSizeParam() const;
143 double getSizeParam(ESizeType sizeType) const;
144 void setSizeParam(double sizeParam, ESizeType sizeType);
145 void setSizeParam(double sizeParam);
146 void setSizeType(ESizeType sizeType);
148 double getShapeParam() const;
149 double getShapeParam(EShapeType shapeType) const;
150 void setShapeParam(double shapeParam, EShapeType shapeType);
151 void setShapeParam(double shapeParam);
152 void setShapeType(EShapeType shapeType);
154 double getOrientationParam() const;
155 double getOrientationParam(EOrientationType orientationType) const;
156 void setOrientationParam(double orientationParam, EOrientationType orientationType);
157 void setOrientationParam(double orientationParam);
158 void setOrientationType(EOrientationType orientationType);
160 double getPositionParam() const;
161 double getPositionParam(EPositionType positionType) const;
162 void setPositionParam(double positionParam, EPositionType positionType);
163 void setPositionParam(double positionParam);
164 void setPositionType(EPositionType positionType);
165public:
167 double getApoAlt() const;
168
170 double getApoRad() const;
171
173 double getPeriAlt() const;
174
176 double getPeriRad() const;
177
179 ESizeType getSizeType() const{return sizeType_;}
180
182 EShapeType getShapeType() const{return shapeType_;}
183
185 EOrientationType getOrientationType() const{return orientationType_;}
186
188 EPositionType getPositionType() const{return positionType_;}
189PROPERTIES:
191 length_d getSMA() const;
193 void setSMA(length_d sma);
194
196 time_d getPeriod() const;
198 void setPeriod(time_d period);
199
201 angvel_d getMeanMotion() const;
203 void setMeanMotion(angvel_d meanMotion);
204
205 length_d getApoRadForSize() const{return getApoRad();}
207 void setApoRadForSize(length_d apoRad);
208
209 length_d getApoAltForSize() const{return getApoAlt();}
211 void setApoAltForSize(length_d apoAlt);
212
213 length_d getPeriRadForSize() const{return getPeriRad();}
215 void setPeriRadForSize(length_d periRad);
216
217 length_d getPeriAltForSize() const{return getPeriAlt();}
219 void setPeriAltForSize(length_d periAlt);
220
222 double getEcc() const;
224 void setEcc(double ecc);
225
226 length_d getApoRadForShape() const{return getApoRad();}
228 void setApoRadForShape(length_d apoRad);
229
230 length_d getApoAltForShape() const{return getApoAlt();}
232 void setApoAltForShape(length_d apoAlt);
233
234 length_d getPeriRadForShape() const{return getPeriRad();}
236 void setPeriRadForShape(length_d periRad);
237
238 length_d getPeriAltForShape() const{return getPeriAlt();}
240 void setPeriAltForShape(length_d periAlt);
241
243 angle_d getInc() const;
245 void setInc(angle_d inc);
246
248 angle_d getRAAN() const;
250 void setRAAN(angle_d raan);
251
253 angle_d getLAN() const;
255 void setLAN(angle_d lan);
256
258 angle_d getArgPeri() const;
260 void setArgPeri(double argPeri);
261
263 angle_d getTrueAnomaly() const;
265 void setTrueAnomaly(angle_d trueAnomaly);
266
268 angle_d getMeanAnomaly() const;
270 void setMeanAnomaly(angle_d meanAnomaly);
271
273 angle_d getEccAnomaly() const;
275 void setEccAnomaly(angle_d eccAnomaly);
276
278 angle_d getArgLat() const;
280 void setArgLat(angle_d argLat);
281
283 time_d getTimePastPeri() const;
285 void setTimePastPeri(time_d timePastPeri);
286
288 time_d getTimePastAscNode() const;
290 void setTimePastAscNode(time_d timePastAscNode);
291
292public:
294 void getTimeOfPeriPassage(TimePoint& tp) const;
296 TimePoint getTimeOfPeriPassage() const;
298 void setTimeOfPeriPassage(const TimePoint& tp);
300 void setTimeOfPeriPassage(double epochsecond);
301
303 void getTimeOfAscNodePassage(TimePoint& tp) const;
305 TimePoint getTimeOfAscNodePassage() const;
307 void setTimeOfAscNodePassage(const TimePoint& tp);
309 void setTimeOfAscNodePassage(double epochsecond);
310private:
311 void changeEccHoldingOthers(double ecc, const ModOrbElem& originalElem);
312 void changePeriRadHoldingOthers(double periRad, const ModOrbElem& originalElem);
313 void changeArgPeriHoldingOthers(double argPeri, const ModOrbElem& originalElem);
314private:
315 void holdLAN(const ModOrbElem& originalElem);
316 void holdMeanAnomaly(const ModOrbElem& originalElem);
317 void holdEccAnomaly(const ModOrbElem& originalElem);
318 void holdArgLat(const ModOrbElem& originalElem);
319 void holdTimePastAscNode(const ModOrbElem& originalElem);
320 void holdTimePastPeri(const ModOrbElem& originalElem);
321protected:
322 ModOrbElem modOrbElem_{};
323 ESizeType sizeType_{ESizeType::eSMA};
324 EShapeType shapeType_{EShapeType::eEcc};
325 EOrientationType orientationType_{EOrientationType::eRAAN};
326 EPositionType positionType_{EPositionType::eTrueAnomaly};
327};
328
331AST_NAMESPACE_END
直角坐标
定义 OrbitElement.hpp:46
修正轨道根数
定义 OrbitElement.hpp:131
经典轨道根数
定义 OrbitElement.hpp:89
共享指针
定义 SharedPtr.hpp:33
开普勒轨道根数状态
定义 StateKeplerian.hpp:86
errc_t getState(ModOrbElem &modOrbElem) const override
获取状态
定义 StateKeplerian.hpp:129
ESizeType getSizeType() const
获取轨道大小的定义方式
定义 StateKeplerian.hpp:179
errc_t setState(const ModOrbElem &modOrbElem) override
设置状态
定义 StateKeplerian.hpp:128
EStateType getStateType() const override
获取状态类型
定义 StateKeplerian.hpp:122
EOrientationType getOrientationType() const
获取轨道面方向的定义方式
定义 StateKeplerian.hpp:185
EShapeType getShapeType() const
获取轨道形状的定义方式
定义 StateKeplerian.hpp:182
EPositionType getPositionType() const
获取轨道位置的定义方式
定义 StateKeplerian.hpp:188
航天器状态
定义 State.hpp:53
static HState MakeShared(EStateType type)
创建状态
定义 State.cpp:41
virtual errc_t getState(CartState &state) const =0
获取状态
virtual errc_t setState(const CartState &state)=0
设置状态
static PState New(EStateType type)
创建状态
定义 State.cpp:51
ESizeType
轨道大小描述方式
定义 StateKeplerian.hpp:41
@ eApoAlt
远地点高度
@ eApoRad
远地点半径
@ eSMA
半长轴
@ ePeriAlt
近地点高度
@ eMeanMotion
平均角速度
@ ePeriRad
近地点半径
EShapeType
轨道形状描述方式
定义 StateKeplerian.hpp:53
@ eEcc
偏心率
EPositionType
轨道位置描述方式
定义 StateKeplerian.hpp:70
@ eTimeOfAscNodePassage
过升交点时刻
@ eTrueAnomaly
真近点角
@ eTimePastAscNode
过升交点后经过的时间
@ eTimeOfPeriPassage
过近地点时刻
@ eEccAnomaly
偏近点角
@ eTimePastPeri
过近地点后经过的时间
@ eMeanAnomaly
平近点角
@ eArgLat
纬度幅角
EStateType
状态类型
定义 State.hpp:39
@ eKeplerian
开普勒状态
EOrientationType
轨道面方向描述方式
定义 StateKeplerian.hpp:63
@ eLAN
升交点经度
@ eRAAN
升交点赤经