Commit 6d60e87f authored by Luc Maisonobe's avatar Luc Maisonobe

Merge branch 'issue-510' into develop

parents 779f4952 885c0691
......@@ -617,7 +617,7 @@ public class TimeStampedFieldPVCoordinates<T extends RealFieldElement<T>>
*/
public TimeStampedFieldPVCoordinates<T> shiftedBy(final T dt) {
final FieldPVCoordinates<T> spv = super.shiftedBy(dt);
return new TimeStampedFieldPVCoordinates<>(date.shiftedBy(dt.getReal()),
return new TimeStampedFieldPVCoordinates<>(date.shiftedBy(dt),
spv.getPosition(), spv.getVelocity(), spv.getAcceleration());
}
......
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="TBD" date="TBD" description="TBD">
<action dev="luc" type="fix" issue="510">
Fixed dropped derivatives in TimeStampedFieldPVCoordinates.shiftedBy(dt).
</action>
<action dev="luc" type="fix" issue="509">
Fixed scaling error in ParameterFunction differentiation.
</action>
......
......@@ -467,7 +467,7 @@ public class BatchLSEstimatorTest {
EstimationTestUtils.checkFit(context, estimator, 2, 3,
0.0, 2.3e-06,
0.0, 6.6e-06,
0.0, 6.2e-07,
0.0, 6.4e-07,
0.0, 2.8e-10);
final Orbit determined = new KeplerianOrbit(parameters.get( 6).getValue(),
......@@ -644,15 +644,15 @@ public class BatchLSEstimatorTest {
a1Driver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
final Orbit before = new KeplerianOrbit(parameters.get( 6).getValue(),
parameters.get( 7).getValue(),
parameters.get( 8).getValue(),
parameters.get( 9).getValue(),
parameters.get(10).getValue(),
parameters.get(11).getValue(),
PositionAngle.TRUE,
closeOrbit.getFrame(),
closeOrbit.getDate(),
closeOrbit.getMu());
parameters.get( 7).getValue(),
parameters.get( 8).getValue(),
parameters.get( 9).getValue(),
parameters.get(10).getValue(),
parameters.get(11).getValue(),
PositionAngle.TRUE,
closeOrbit.getFrame(),
closeOrbit.getDate(),
closeOrbit.getMu());
Assert.assertEquals(4.7246,
Vector3D.distance(closeOrbit.getPVCoordinates().getPosition(),
before.getPVCoordinates().getPosition()),
......@@ -661,7 +661,7 @@ public class BatchLSEstimatorTest {
Vector3D.distance(closeOrbit.getPVCoordinates().getVelocity(),
before.getPVCoordinates().getVelocity()),
1.0e-6);
EstimationTestUtils.checkFit(context, estimator, 4, 5,
EstimationTestUtils.checkFit(context, estimator, 3, 4,
0.0, 6.0e-06,
0.0, 1.7e-05,
0.0, 4.4e-07,
......
......@@ -357,6 +357,27 @@ public class TimeStampedFieldPVCoordinatesTest {
}
@Test
public void testIssue510() {
DSFactory factory = new DSFactory(1, 1);
TimeStampedFieldPVCoordinates<DerivativeStructure> pv =
new TimeStampedFieldPVCoordinates<>(FieldAbsoluteDate.getJ2000Epoch(factory.getDerivativeField()),
new FieldVector3D<>(factory.constant(10.0),
factory.constant(20.0),
factory.constant(30.0)),
new FieldVector3D<>(factory.constant(1.0),
factory.constant(2.0),
factory.constant(3.0)),
FieldVector3D.getZero(factory.getDerivativeField()));
DerivativeStructure dt = factory.variable(0, 1.0);
TimeStampedFieldPVCoordinates<DerivativeStructure> shifted = pv.shiftedBy(dt);
Assert.assertEquals(1.0, shifted.getDate().durationFrom(pv.getDate()).getPartialDerivative(1), 1.0e-15);
Assert.assertEquals(pv.getVelocity().getX().getValue(), shifted.getPosition().getX().getPartialDerivative(1), 1.0e-15);
Assert.assertEquals(pv.getVelocity().getY().getValue(), shifted.getPosition().getY().getPartialDerivative(1), 1.0e-15);
Assert.assertEquals(pv.getVelocity().getZ().getValue(), shifted.getPosition().getZ().getPartialDerivative(1), 1.0e-15);
}
private PolynomialFunction randomPolynomial(int degree, Random random) {
double[] coeff = new double[ 1 + degree];
for (int j = 0; j < degree; ++j) {
......
Markdown is supported
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