🛰️航天仿真算法库 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
112 static PStateKeplerian New();
114 static PStateKeplerian New(const ModOrbElem& modOrbElem);
115 static HStateKeplerian MakeShared(const ModOrbElem& modOrbElem);
116 static PStateKeplerian NewDefault();
117
119 StateKeplerian(const ModOrbElem& modOrbElem);
120 StateKeplerian(const State& state);
121 ~StateKeplerian() override = default;
122public:
123 EStateType getStateType() const override { return EStateType::eKeplerian; }
124 errc_t getState(CartState& state) const override;
125 errc_t setState(const CartState& state) override;
126public:
127 void setState(OrbElem& orbElem);
128 void getState(OrbElem& orbElem) const;
129 errc_t setState(const ModOrbElem& modOrbElem) override { modOrbElem_ = modOrbElem; return eNoError; }
130 errc_t getState(ModOrbElem& modOrbElem) const override { modOrbElem = modOrbElem_; return eNoError; }
131public:
133 void getInnerRepresentationState(array6d& stateInRepresentation) const;
135 void getStateInRepresentation(
136 ESizeType sizeType, EShapeType shapeType,
137 EOrientationType orientationType, EPositionType positionType,
138 array6d& stateInRepresentation
139 ) const;
140 double getStateParam(int index);
141 void setStateParam(int index, double value);
143 double getSizeParam() const;
144 double getSizeParam(ESizeType sizeType) const;
145 void setSizeParam(double sizeParam, ESizeType sizeType);
146 void setSizeParam(double sizeParam);
147 void setSizeType(ESizeType sizeType);
149 double getShapeParam() const;
150 double getShapeParam(EShapeType shapeType) const;
151 void setShapeParam(double shapeParam, EShapeType shapeType);
152 void setShapeParam(double shapeParam);
153 void setShapeType(EShapeType shapeType);
155 double getOrientationParam() const;
156 double getOrientationParam(EOrientationType orientationType) const;
157 void setOrientationParam(double orientationParam, EOrientationType orientationType);
158 void setOrientationParam(double orientationParam);
159 void setOrientationType(EOrientationType orientationType);
161 double getPositionParam() const;
162 double getPositionParam(EPositionType positionType) const;
163 void setPositionParam(double positionParam, EPositionType positionType);
164 void setPositionParam(double positionParam);
165 void setPositionType(EPositionType positionType);
166public:
168 double getApoAlt() const;
169
171 double getApoRad() const;
172
174 double getPeriAlt() const;
175
177 double getPeriRad() const;
178
180 ESizeType getSizeType() const{return sizeType_;}
181
183 EShapeType getShapeType() const{return shapeType_;}
184
186 EOrientationType getOrientationType() const{return orientationType_;}
187
189 EPositionType getPositionType() const{return positionType_;}
190PROPERTIES:
192 length_d getSMA() const;
194 void setSMA(length_d sma);
195
197 time_d getPeriod() const;
199 void setPeriod(time_d period);
200
202 angvel_d getMeanMotion() const;
204 void setMeanMotion(angvel_d meanMotion);
205
206 length_d getApoRadForSize() const{return getApoRad();}
208 void setApoRadForSize(length_d apoRad);
209
210 length_d getApoAltForSize() const{return getApoAlt();}
212 void setApoAltForSize(length_d apoAlt);
213
214 length_d getPeriRadForSize() const{return getPeriRad();}
216 void setPeriRadForSize(length_d periRad);
217
218 length_d getPeriAltForSize() const{return getPeriAlt();}
220 void setPeriAltForSize(length_d periAlt);
221
223 double getEcc() const;
225 void setEcc(double ecc);
226
227 length_d getApoRadForShape() const{return getApoRad();}
229 void setApoRadForShape(length_d apoRad);
230
231 length_d getApoAltForShape() const{return getApoAlt();}
233 void setApoAltForShape(length_d apoAlt);
234
235 length_d getPeriRadForShape() const{return getPeriRad();}
237 void setPeriRadForShape(length_d periRad);
238
239 length_d getPeriAltForShape() const{return getPeriAlt();}
241 void setPeriAltForShape(length_d periAlt);
242
244 angle_d getInc() const;
246 void setInc(angle_d inc);
247
249 angle_d getRAAN() const;
251 void setRAAN(angle_d raan);
252
254 angle_d getLAN() const;
256 void setLAN(angle_d lan);
257
259 angle_d getArgPeri() const;
261 void setArgPeri(double argPeri);
262
264 angle_d getTrueAnomaly() const;
266 void setTrueAnomaly(angle_d trueAnomaly);
267
269 angle_d getMeanAnomaly() const;
271 void setMeanAnomaly(angle_d meanAnomaly);
272
274 angle_d getEccAnomaly() const;
276 void setEccAnomaly(angle_d eccAnomaly);
277
279 angle_d getArgLat() const;
281 void setArgLat(angle_d argLat);
282
284 time_d getTimePastPeri() const;
286 void setTimePastPeri(time_d timePastPeri);
287
289 time_d getTimePastAscNode() const;
291 void setTimePastAscNode(time_d timePastAscNode);
292
293public:
295 void getTimeOfPeriPassage(TimePoint& tp) const;
297 TimePoint getTimeOfPeriPassage() const;
299 void setTimeOfPeriPassage(const TimePoint& tp);
301 void setTimeOfPeriPassage(double epochsecond);
302
304 void getTimeOfAscNodePassage(TimePoint& tp) const;
306 TimePoint getTimeOfAscNodePassage() const;
308 void setTimeOfAscNodePassage(const TimePoint& tp);
310 void setTimeOfAscNodePassage(double epochsecond);
311private:
312 void changeEccHoldingOthers(double ecc, const ModOrbElem& originalElem);
313 void changePeriRadHoldingOthers(double periRad, const ModOrbElem& originalElem);
314 void changeArgPeriHoldingOthers(double argPeri, const ModOrbElem& originalElem);
315private:
316 void holdLAN(const ModOrbElem& originalElem);
317 void holdMeanAnomaly(const ModOrbElem& originalElem);
318 void holdEccAnomaly(const ModOrbElem& originalElem);
319 void holdArgLat(const ModOrbElem& originalElem);
320 void holdTimePastAscNode(const ModOrbElem& originalElem);
321 void holdTimePastPeri(const ModOrbElem& originalElem);
322protected:
323 ModOrbElem modOrbElem_{};
324 ESizeType sizeType_{ESizeType::eSMA};
325 EShapeType shapeType_{EShapeType::eEcc};
326 EOrientationType orientationType_{EOrientationType::eRAAN};
327 EPositionType positionType_{EPositionType::eTrueAnomaly};
328};
329
332AST_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:130
ESizeType getSizeType() const
获取轨道大小的定义方式
定义 StateKeplerian.hpp:180
errc_t setState(const ModOrbElem &modOrbElem) override
设置状态
定义 StateKeplerian.hpp:129
EStateType getStateType() const override
获取状态类型
定义 StateKeplerian.hpp:123
EOrientationType getOrientationType() const
获取轨道面方向的定义方式
定义 StateKeplerian.hpp:186
EShapeType getShapeType() const
获取轨道形状的定义方式
定义 StateKeplerian.hpp:183
EPositionType getPositionType() const
获取轨道位置的定义方式
定义 StateKeplerian.hpp:189
航天器状态
定义 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
升交点赤经