1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
use super::thiserror::Error;
use crate::md::trajectory::TrajError;
pub use crate::md::TargetingError;
pub use crate::time::Errors as TimeErrors;
use crate::Spacecraft;
use std::convert::From;
#[derive(Clone, PartialEq, Error, Debug)]
pub enum NyxError {
#[error("STM is singular, propagation or smoothing cannot proceed")]
SingularStateTransitionMatrix,
#[error("Fuel exhausted at {0}")]
FuelExhausted(Box<Spacecraft>),
#[error("Propagation event not triggered within the max propagation time")]
ConditionNeverTriggered,
#[error("Propagation event not hit enough times (requested, found).")]
UnsufficientTriggers(usize, usize),
#[error("Maximum iterations of {0} reached")]
MaxIterReached(String),
#[error("Event not in braket: {0} <=> {1}")]
EventNotInEpochBraket(String, String),
#[error("The operation was expecting the state to have an STM, but it isn't present.")]
StateTransitionMatrixUnset,
#[error("The sensitivity matrix must be updated prior to a filter measurement update")]
SensitivityNotUpdated,
#[error("Gain could not be computed because H*P_bar*H + R is singular")]
SingularKalmanGain,
#[error("Singular Covariance")]
SingularCovarianceMatrix,
#[error("Covariance is not positive semi definite")]
CovarianceMatrixNotPsd,
#[error("Singular Jacobian")]
SingularJacobian,
#[error("Lambert too close: Δν ~=0 and A ~=0")]
TargetsTooClose,
#[error("No reasonable phi found to connect both radii")]
LambertNotReasonablePhi,
#[error("Use the Izzo algorithm for multi-rev transfers")]
LambertMultiRevNotSupported,
#[error("Partials for this model are not defined")]
PartialsUndefined,
#[error("State parameter cannot be used in this function")]
StateParameterUnavailable,
#[error("Could not load file: {0}")]
LoadingError(String),
#[error("Could not read file: {0}")]
FileUnreadable(String),
#[error("Cosm object not found: {0}")]
ObjectNotFound(String),
#[error("No interpolation data: {0}")]
NoInterpolationData(String),
#[error("Invalid interpolation data: {0}")]
InvalidInterpolationData(String),
#[error("No state data: {0}")]
NoStateData(String),
#[error("Cannot convert between disjoint frames: {0} <-> {1}")]
DisjointFrameOrientations(String, String),
#[error("No thruster attached to spacecraft")]
NoThrusterAvail,
#[error("Control vector is not a unit vector: {0}")]
CtrlNotAUnitVector(f64),
#[error("Throttle is not between 0.0 and 1.0: {0}")]
CtrlThrottleRangeErr(f64),
#[error("Happens when trying to modify a polynomial's (error)-th error but the polynomial has less orders than that")]
PolynomialOrderError(usize),
#[error("An objective based analysis or control was attempted, but no objective was defined")]
NoObjectiveDefined,
#[error("Error when exporting data: {0}")]
ExportError(String),
#[error("This computation requires the orbit to be hyperbolic: {0}")]
NotHyperbolic(String),
#[error("Control variables to not decrease targeting error in differential corrector: {0}")]
CorrectionIneffective(String),
#[error("Monte Carlo error: {0}")]
MonteCarlo(String),
#[error("CCSDS error: {0}")]
CCSDS(String),
#[error("Multiple shooting failed on node {0} with {1}")]
MultipleShootingTargeter(usize, Box<NyxError>),
#[error("Custom error: {0}")]
CustomError(String),
#[error("Time related error: {0}")]
TimeError(TimeErrors),
#[error("Targeting error: {0}")]
Targeter(Box<TargetingError>),
#[error("Trajectory error: {0}")]
Trajectory(TrajError),
#[error("Math domain error: {0}")]
MathDomain(String),
#[error("Guidance law config error: {0}")]
GuidanceConfigError(String),
}
impl From<TimeErrors> for NyxError {
fn from(e: TimeErrors) -> Self {
NyxError::TimeError(e)
}
}
impl From<TrajError> for NyxError {
fn from(e: TrajError) -> Self {
NyxError::Trajectory(e)
}
}