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
use std::error::Error;
use std::fmt;
#[derive(Clone, PartialEq, Debug)]
pub enum NyxError {
SingularStateTransitionMatrix,
FuelExhausted,
ConditionNeverTriggered,
UnsufficientTriggers(usize, usize),
MaxIterReached(String),
EventNotInEpochBraket(String, String),
StateTransitionMatrixNotUpdated,
StateTransitionMatrixUnset,
SensitivityNotUpdated,
SingularKalmanGain,
SingularCovarianceMatrix,
TargetsTooClose,
LambertNotReasonablePhi,
LambertMultiRevNotSupported,
PartialsUndefined,
LoadingError(String),
FileUnreadable(String),
ObjectNotFound(String),
NoInterpolationData(String),
InvalidInterpolationData(String),
OutOfInterpolationWindow(String),
NoStateData(String),
DisjointFrameOrientations(String, String),
CtrlExistsButNoThrusterAvail,
CtrlNotAUnitVector(f64),
CtrlThrottleRangeErr(f64),
NoObjectiveDefined,
ExportError(String),
NotHyperbolic(String),
CorrectionIneffective(String),
MonteCarlo(String),
TargetError(String),
UnderdeterminedProblem,
CustomError(String),
}
impl fmt::Display for NyxError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Self::StateTransitionMatrixNotUpdated => {
write!(f, "STM was not updated prior to time or measurement update")
}
Self::SensitivityNotUpdated => write!(
f,
"The measurement matrix H_tilde was not updated prior to measurement update"
),
Self::SingularKalmanGain => write!(
f,
"Gain could not be computed because H*P_bar*H + R is singular"
),
Self::SingularStateTransitionMatrix => write!(
f,
"STM is singular, propagation or smoothing cannot proceed"
),
Self::SingularCovarianceMatrix => {
write!(f, "Covariance is singular, smoothing cannot proceed")
}
Self::FuelExhausted => write!(
f,
"Spacecraft fuel exhausted, disable fuel depletion and place maneuvers"
),
Self::ConditionNeverTriggered => write!(
f,
"Try increasing the search space, i.e. increase the maximum propagation time"
),
Self::TargetsTooClose => write!(f, "Lambert too close: Δν ~=0 and A ~=0"),
Self::LambertMultiRevNotSupported => {
write!(f, "Use the Izzo algorithm for multi-rev transfers")
}
Self::LambertNotReasonablePhi => {
write!(f, "No reasonable phi found to connect both radii")
}
_ => write!(f, "{:?}", self),
}
}
}
impl Error for NyxError {}