🛰️航天仿真算法库 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
31class AST_MATH_API ODEEventObserver: public ODEStateObserver
32{
33public:
34 ODEEventObserver() = default;
35 ODEEventObserver(const ODEEventObserver&) = delete;
36 ODEEventObserver& operator=(const ODEEventObserver&) = delete;
37 explicit ODEEventObserver(ODEEventDetector* detector);
38 ~ODEEventObserver() override;
39 EODEAction onStateUpdate(double* y, double& x, ODEIntegrator* integrator) final;
40 ODEEventDetector* getEventDetector() const { return detector_; }
41 bool isEventOccurred(double* y, double& x);
42 errc_t findEventTime(double x1, double x2, double& result, ODEIntegrator* integrator);
43protected:
44 friend class ODEEventDetectorList;
45 ODEEventDetector* detector_ {nullptr};
46 double lastDifference_ {std::numeric_limits<double>::quiet_NaN()};
47 double lastTime_{std::numeric_limits<double>::quiet_NaN()};
48 double eventTime_{std::numeric_limits<double>::quiet_NaN()};
49 int repeatCount_{-1};
50};
51
52AST_NAMESPACE_END
定义 ODEEventDetectorList.hpp:32
ODE积分的事件检测器
定义 ODEEventDetector.hpp:36
定义 ODEEventObserver.hpp:32
ODE 积分器
定义 ODEIntegrator.hpp:87
ODE状态量观察者
定义 ODEStateObserver.hpp:39
virtual EODEAction onStateUpdate(double *y, double &x, ODEIntegrator *integrator)=0
状态更新处理函数