Commit 925c95a8 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Reduce discontinuities across impulsive maneuvers.

Fixes #836
parent f255c874
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="11.1" date="TBD" description="TBD">
<action dev="luc" type="fix" issue="836">
Use the orbit normalization feature to reduce discontinuities across impulsive maneuvers.
</action>
<action dev="luc" type="add">
Added an orbit normalization feature.
</action>
......
......@@ -234,7 +234,7 @@ public class ImpulseManeuver<T extends EventDetector> extends AbstractDetector<I
final double newMass = oldState.getMass() * FastMath.exp(-sign * deltaV.getNorm() / im.vExhaust);
// pack everything in a new state
SpacecraftState newState = new SpacecraftState(oldState.getOrbit().getType().convertType(newOrbit),
SpacecraftState newState = new SpacecraftState(oldState.getOrbit().getType().normalize(newOrbit, oldState.getOrbit()),
attitude, newMass);
for (final DoubleArrayDictionary.Entry entry : oldState.getAdditionalStatesValues().getData()) {
newState = newState.addAdditionalState(entry.getKey(), entry.getValue());
......
......@@ -59,7 +59,7 @@ public class ImpulseManeuverTest {
@Test
public void testInclinationManeuver() {
final Orbit initialOrbit =
new KeplerianOrbit(24532000.0, 0.72, 0.3, FastMath.PI, 0.4, 2.0,
new KeplerianOrbit(24532000.0, 0.72, 0.3, FastMath.PI, 0.4, 2.0 + 4 * FastMath.PI,
PositionAngle.MEAN, FramesFactory.getEME2000(),
new AbsoluteDate(new DateComponents(2008, 06, 23),
new TimeComponents(14, 18, 37),
......@@ -77,6 +77,7 @@ public class ImpulseManeuverTest {
new Vector3D(dv, Vector3D.PLUS_J), 400.0));
SpacecraftState propagated = propagator.propagate(initialOrbit.getDate().shiftedBy(8000));
Assert.assertEquals(0.0028257, propagated.getI(), 1.0e-6);
Assert.assertEquals(0.442476 + 6 * FastMath.PI, ((KeplerianOrbit) propagated.getOrbit()).getLv(), 1.0e-6);
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment