🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
StateMapper.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstCore/TimePoint.hpp"
25
26AST_NAMESPACE_BEGIN
27
36{
37public:
38 StateMapper() = default;
39 virtual ~StateMapper() = default;
40
44 virtual void toState(const double* y, double x, SpacecraftState& state) const = 0;
45
49 virtual void fromState(const SpacecraftState& state, double* y, double& x) const = 0;
50
54 void toTime(double x, TimePoint& time) const
55 {
56 time = epoch_ + x;
57 }
58
62 void fromTime(const TimePoint& time, double& x) const
63 {
64 x = time - epoch_;
65 }
66public:
67
70 const TimePoint& epoch() const{return epoch_;}
71
74 void setEpoch(TimePoint epoch){epoch_ = epoch;}
75private:
76 TimePoint epoch_;
77};
78
81AST_NAMESPACE_END
航天器状态,包含轨道状态、航天器参数(质量、面积、阻力系数、光压、密度、压力、温度等)
定义 SpacecraftState.hpp:39
状态映射器
定义 StateMapper.hpp:36
void setEpoch(TimePoint epoch)
设置参考历元
定义 StateMapper.hpp:74
virtual void fromState(const SpacecraftState &state, double *y, double &x) const =0
将状态量映射到状态向量
const TimePoint & epoch() const
获取参考历元
定义 StateMapper.hpp:70
void fromTime(const TimePoint &time, double &x) const
将时间点映射到自变量
定义 StateMapper.hpp:62
virtual void toState(const double *y, double x, SpacecraftState &state) const =0
将状态向量映射到状态量
void toTime(double x, TimePoint &time) const
将自变量映射到时间点
定义 StateMapper.hpp:54
绝对时间点
定义 TimePoint.hpp:107