WSF
WsfOrbitalTargeting.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2017 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFORBITALTARGETING_HPP
13#define WSFORBITALTARGETING_HPP
14
15#include "wsf_space_export.h"
16
17#include <numeric>
18#include <utility>
19#include <vector>
20
21#include "UtCalendar.hpp"
22#include "UtCloneablePtr.hpp"
23#include "UtLambertProblem.hpp"
24class UtOrbitalPropagatorBase;
25#include "UtVec3.hpp"
26
27namespace wsf
28{
29namespace space
30{
33} // namespace space
34} // namespace wsf
35
37class WSF_SPACE_EXPORT WsfOrbitalTargeting
38{
39public:
40 WsfOrbitalTargeting(const UtCalendar& aTime,
41 UtOrbitalPropagatorBase& aInterceptorProp,
42 const wsf::space::OrbitalTargetPoint& aTarget);
43
44 WsfOrbitalTargeting(const UtCalendar& aTime,
45 UtOrbitalPropagatorBase& aInterceptorProp,
46 const wsf::space::OrbitalTargetPoint& aTarget,
47 bool aAllowHyperbolic,
48 bool aAllowEarthHit);
49
52
54
55 UtLambertProblem::Result
56 MinimizeDeltaV(double aDtMax, double aDvMax, bool aRendezvous, double aTimeTolerance, double& aDt, double& aDv) const;
57
58 UtLambertProblem::Result
59 MinimizeDeltaT(double aDtMax, double aDvMax, bool aRendezvous, double aTimeTolerance, double& aDt, double& aDv) const;
60
76 UtLambertProblem::Result MinimizeCost(const wsf::space::OrbitalTargetingCost& aCost,
77 double aDtMax,
78 double aDvMax,
79 bool aRendezvous,
80 double aTimeTolerance,
81 double& aDt,
82 double& aDv) const;
83
84 static bool GoShortWay(const UtVec3d& aLocationInterceptor,
85 const UtVec3d& aVelocityInterceptor,
86 const UtVec3d& aLocationTarget);
87
88 UtLambertProblem::Result Solve(double aDt, bool aRendezvous, double& aDeltaV) const;
89
90 UtLambertProblem::Result Solve(double aDt, UtVec3d& aDeltaV_Intercept, UtVec3d& aDeltaV_Rendezvous) const;
91
92 double GetTolerance() const { return mTolerance; }
93
94 void SetTolerance(double aTolerance) { mTolerance = aTolerance; }
95
96private:
98 struct Sample
99 {
100 Sample() = default;
101 Sample(double aDt, double aDv, bool aHasSolution)
102 : mDt{aDt}
103 , mDv{aDv}
104 , mHasSolution{aHasSolution}
105 {
106 }
107
108 double mDt{std::numeric_limits<double>::max()};
109 double mDv{std::numeric_limits<double>::max()};
110 double mCost{std::numeric_limits<double>::max()};
111 bool mHasSolution{false};
112 };
113
114 Sample Solve(double aDt, bool aRendezvous) const;
115
127 std::vector<std::pair<double, double>> FindAllRangesCost(const wsf::space::OrbitalTargetingCost& aCost,
128 double aDtZero,
129 double aDtMax,
130 double aDvMax,
131 bool aRendezvous) const;
132
146 UtLambertProblem::Result SearchCost(const wsf::space::OrbitalTargetingCost& aCost,
147 double aDtLow,
148 double aDtHigh,
149 bool aRendezvous,
150 double aDvMax,
151 double aTimeTolerance,
152 double& aDeltaV) const;
153
154 const UtCalendar mTime;
155 UtOrbitalPropagatorBase& mInterceptorProp;
156 UtCloneablePtr<wsf::space::OrbitalTargetPoint> mTargetPtr;
157 double mTolerance{1.0e-9};
158 bool mAllowEarthHit{false};
159};
160
161#endif
double GetTolerance() const
Definition WsfOrbitalTargeting.hpp:92
UtLambertProblem::Result MinimizeDeltaV(double aDtMax, double aDvMax, bool aRendezvous, double aTimeTolerance, double &aDt, double &aDv) const
Definition WsfOrbitalTargeting.cpp:65
UtLambertProblem::Result MinimizeDeltaT(double aDtMax, double aDvMax, bool aRendezvous, double aTimeTolerance, double &aDt, double &aDv) const
Definition WsfOrbitalTargeting.cpp:88
UtLambertProblem::Result Solve(double aDt, bool aRendezvous, double &aDeltaV) const
Definition WsfOrbitalTargeting.cpp:213
WsfOrbitalTargeting(WsfOrbitalTargeting &&)=default
~WsfOrbitalTargeting()=default
void SetTolerance(double aTolerance)
Definition WsfOrbitalTargeting.hpp:94
WsfOrbitalTargeting(const UtCalendar &aTime, UtOrbitalPropagatorBase &aInterceptorProp, const wsf::space::OrbitalTargetPoint &aTarget)
Definition WsfOrbitalTargeting.cpp:23
static bool GoShortWay(const UtVec3d &aLocationInterceptor, const UtVec3d &aVelocityInterceptor, const UtVec3d &aLocationTarget)
Definition WsfOrbitalTargeting.cpp:193
UtLambertProblem::Result MinimizeCost(const wsf::space::OrbitalTargetingCost &aCost, double aDtMax, double aDvMax, bool aRendezvous, double aTimeTolerance, double &aDt, double &aDv) const
Definition WsfOrbitalTargeting.cpp:155
WsfOrbitalTargeting(const WsfOrbitalTargeting &aOther)=delete
Definition WsfOrbitalTargetPoint.hpp:30
A cost function to minimize when computing a solution for an orbital targeting operation.
Definition WsfOrbitalTargetingCost.hpp:29
Definition WsfAtmosphere.cpp:23
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved