🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ODEEventObserver.hpp
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstMath/ODEStateObserver.hpp"
25#include "AstMath/ODEEventDetector.hpp"
26#include <limits>
27
28AST_NAMESPACE_BEGIN
29
30
32{
33public:
34 ODEEventObserver() = default;
35 explicit ODEEventObserver(ODEEventDetector* detector);
36 ~ODEEventObserver() override;
37 EODEAction onStateUpdate(double* y, double& x, ODEIntegrator* integrator) final;
38 ODEEventDetector* getEventDetector() const { return detector_; }
39 bool isEventOccurred(double* y, double& x);
40 errc_t findEventTime(double x1, double x2, double& result, ODEIntegrator* integrator);
41protected:
42 friend class ODEEventDetectorList;
43 ODEEventDetector* detector_ {nullptr};
44 double lastDifference_ {std::numeric_limits<double>::quiet_NaN()};
45 double lastTime_{std::numeric_limits<double>::quiet_NaN()};
46 double eventTime_{std::numeric_limits<double>::quiet_NaN()};
47 int repeatCount_{-1};
48};
49
50AST_NAMESPACE_END
定义 ODEEventDetectorList.hpp:32
ODE积分的事件检测器
定义 ODEEventDetector.hpp:33
定义 ODEEventObserver.hpp:32
ODE 积分器
定义 ODEIntegrator.hpp:81
ODE状态量观察者
定义 ODEStateObserver.hpp:39