Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Orekit
Orekit
Commits
66b7bdb0
Commit
66b7bdb0
authored
Jan 10, 2022
by
Bryan Cazabonne
Browse files
Fixed initialization of maneuver trigger events.
Fixes #874
parent
24c4da7a
Pipeline
#1629
passed with stages
in 20 minutes and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/changes/changes.xml
View file @
66b7bdb0
...
...
@@ -21,6 +21,9 @@
</properties>
<body>
<release
version=
"11.1"
date=
"TBD"
description=
"TBD"
>
<action
dev=
"bryan"
type=
"fix"
issue=
"874"
>
Fixed initialization of maneuver trigger events when using EventBasedManeuverTriggers.
</action>
<action
dev=
"luc"
type=
"fix"
issue=
"872"
>
Fixed multiple detection of events when using propagate(start, target) with
integration-based propagators.
...
...
src/main/java/org/orekit/forces/maneuvers/trigger/EventBasedManeuverTriggers.java
View file @
66b7bdb0
...
...
@@ -144,6 +144,8 @@ public class EventBasedManeuverTriggers implements ManeuverTriggers, EventHandle
// backward propagation was forbidden
throw
new
OrekitException
(
OrekitMessages
.
BACKWARD_PROPAGATION_NOT_ALLOWED
);
}
startFiringDetector
.
init
(
initialState
,
target
);
stopFiringDetector
.
init
(
initialState
,
target
);
checkInitialFiringState
(
initialState
);
...
...
src/test/java/org/orekit/forces/maneuvers/ConfigurableLowThrustManeuverTest.java
View file @
66b7bdb0
...
...
@@ -50,6 +50,7 @@ import org.orekit.propagation.events.AbstractDetector;
import
org.orekit.propagation.events.BooleanDetector
;
import
org.orekit.propagation.events.EventDetector
;
import
org.orekit.propagation.events.NegateDetector
;
import
org.orekit.propagation.events.PositionAngleDetector
;
import
org.orekit.propagation.events.handlers.ContinueOnEvent
;
import
org.orekit.propagation.events.handlers.EventHandler
;
import
org.orekit.propagation.events.handlers.StopOnEvent
;
...
...
@@ -358,6 +359,19 @@ public class ConfigurableLowThrustManeuverTest {
maneuverStopDetector
,
thrust
,
isp
);
}
private
ConfigurableLowThrustManeuver
buildPsoManeuver
()
{
final
PositionAngleDetector
maneuverStartDetector
=
new
PositionAngleDetector
(
OrbitType
.
EQUINOCTIAL
,
PositionAngle
.
MEAN
,
FastMath
.
toRadians
(
0.0
));
final
PositionAngleDetector
maneuverStopDetector
=
new
PositionAngleDetector
(
OrbitType
.
EQUINOCTIAL
,
PositionAngle
.
MEAN
,
FastMath
.
toRadians
(
90.0
));
// thrust in velocity direction to increase semi-major-axis
return
new
ConfigurableLowThrustManeuver
(
buildVelocityThrustDirectionProvider
(),
maneuverStartDetector
,
maneuverStopDetector
,
thrust
,
isp
);
}
@Test
public
void
testNominalUseCase
()
{
/////////////////// initial conditions /////////////////////////////////
...
...
@@ -734,6 +748,31 @@ public class ConfigurableLowThrustManeuverTest {
}
@Test
public
void
testIssue874
()
{
/////////////////// initial conditions /////////////////////////////////
final
KeplerianOrbit
initOrbit
=
buildInitOrbit
();
final
double
initMass
=
20
;
final
SpacecraftState
initialState
=
new
SpacecraftState
(
initOrbit
,
initMass
);
final
AbsoluteDate
initialDate
=
initOrbit
.
getDate
();
final
double
simulationDuration
=
2
*
86400
;
final
AbsoluteDate
finalDate
=
initialDate
.
shiftedBy
(
simulationDuration
);
/////////////////// propagations /////////////////////////////////
final
NumericalPropagator
numericalPropagator
=
buildNumericalPropagator
(
initOrbit
);
numericalPropagator
.
addForceModel
(
buildPsoManeuver
());
numericalPropagator
.
setInitialState
(
initialState
);
final
SpacecraftState
finalStateNumerical
=
numericalPropagator
.
propagate
(
finalDate
);
/////////////////// results check /////////////////////////////////
final
double
expectedPropellantConsumption
=
-
0.028
;
final
double
expectedDeltaSemiMajorAxisRealized
=
20920
;
Assert
.
assertEquals
(
expectedPropellantConsumption
,
finalStateNumerical
.
getMass
()
-
initialState
.
getMass
(),
0.005
);
Assert
.
assertEquals
(
expectedDeltaSemiMajorAxisRealized
,
finalStateNumerical
.
getA
()
-
initialState
.
getA
(),
100
);
}
@Test
(
expected
=
OrekitException
.
class
)
public
void
testStartDetectorNotSet
()
{
new
ConfigurableLowThrustManeuver
(
buildVelocityThrustDirectionProvider
(),
null
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment