Commit 5f99dd96 authored by Luc Maisonobe's avatar Luc Maisonobe

Changed dependency to Hipparchus 1.2.

parent 28b749ce
......@@ -18,7 +18,7 @@
<property name="lib.dir" location="lib" />
<property name="hipparchus.version" value="1.1" />
<property name="hipparchus.version" value="1.2" />
<property name="hipparchus.core.jar" value="hipparchus-core-${hipparchus.version}.jar" />
<property name="hipparchus.geometry.jar" value="hipparchus-geometry-${hipparchus.version}.jar" />
<property name="hipparchus.ode.jar" value="hipparchus-ode-${hipparchus.version}.jar" />
......
......@@ -41,7 +41,7 @@
<orekit.maven-surefire-plugin.version>2.20</orekit.maven-surefire-plugin.version>
<orekit.maven-surefire-report-plugin.version>2.20</orekit.maven-surefire-report-plugin.version>
<orekit.jgit.buildnumber.version>1.2.10</orekit.jgit.buildnumber.version>
<orekit.hipparchus.version>1.1</orekit.hipparchus.version>
<orekit.hipparchus.version>1.2</orekit.hipparchus.version>
<orekit.junit.version>4.12</orekit.junit.version>
<orekit.compiler.source>1.8</orekit.compiler.source>
<orekit.compiler.target>1.8</orekit.compiler.target>
......
......@@ -22,9 +22,13 @@ import org.hipparchus.RealFieldElement;
import org.hipparchus.exception.DummyLocalizable;
import org.hipparchus.exception.LocalizedCoreFormats;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.stat.descriptive.rank.Max;
import org.hipparchus.stat.descriptive.rank.Min;
import org.hipparchus.util.Decimal64Field;
import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathUtils;
import org.hipparchus.util.Tuple;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
......@@ -46,6 +50,7 @@ import org.orekit.orbits.FieldCircularOrbit;
import org.orekit.orbits.FieldEquinoctialOrbit;
import org.orekit.orbits.FieldKeplerianOrbit;
import org.orekit.orbits.FieldOrbit;
import org.orekit.orbits.KeplerianOrbit;
import org.orekit.orbits.OrbitType;
import org.orekit.orbits.PositionAngle;
import org.orekit.propagation.FieldBoundedPropagator;
......@@ -76,6 +81,7 @@ import org.orekit.utils.FieldPVCoordinatesProvider;
import org.orekit.utils.IERSConventions;
import org.orekit.utils.PVCoordinatesProvider;
import org.orekit.utils.TimeStampedFieldPVCoordinates;
import org.orekit.utils.TimeStampedPVCoordinates;
public class FieldKeplerianPropagatorTest {
......@@ -83,6 +89,65 @@ public class FieldKeplerianPropagatorTest {
// Body mu
private double mu;
@Test
public void testTuple() throws OrekitException {
AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
KeplerianOrbit k0 = new KeplerianOrbit(7209668.0, 0.5e-4, 1.7, 2.1, 2.9,
6.2, PositionAngle.TRUE,
FramesFactory.getEME2000(), initDate, mu);
TimeStampedPVCoordinates pv0 = k0.getPVCoordinates();
TimeStampedPVCoordinates pv1 = new TimeStampedPVCoordinates(pv0.getDate(),
pv0.getPosition(),
pv0.getVelocity().add(new Vector3D(2.0, pv0.getVelocity().normalize())));
KeplerianOrbit k1 = new KeplerianOrbit(pv1, k0.getFrame(), k0.getMu());
FieldOrbit<Tuple> twoOrbits =
new FieldKeplerianOrbit<>(new Tuple(k0.getA(), k1.getA()),
new Tuple(k0.getE(), k1.getE()),
new Tuple(k0.getI(), k1.getI()),
new Tuple(k0.getPerigeeArgument(), k1.getPerigeeArgument()),
new Tuple(k0.getRightAscensionOfAscendingNode(), k1.getRightAscensionOfAscendingNode()),
new Tuple(k0.getMeanAnomaly(), k1.getMeanAnomaly()),
PositionAngle.MEAN,
FramesFactory.getEME2000(),
new FieldAbsoluteDate<>(initDate, new Tuple(0.0, 0.0)),
mu);
Field<Tuple> field = twoOrbits.getDate().getField();
FieldPropagator<Tuple> propagator = new FieldKeplerianPropagator<>(twoOrbits);
Min minTangential = new Min();
Max maxTangential = new Max();
Min minRadial = new Min();
Max maxRadial = new Max();
propagator.setMasterMode(field.getZero().add(10.0),
(s, isLast) -> {
FieldVector3D<Tuple> p = s.getPVCoordinates().getPosition();
FieldVector3D<Tuple> v = s.getPVCoordinates().getVelocity();
Vector3D p0 = new Vector3D(p.getX().getComponent(0),
p.getY().getComponent(0),
p.getZ().getComponent(0));
Vector3D v0 = new Vector3D(v.getX().getComponent(0),
v.getY().getComponent(0),
v.getZ().getComponent(0));
Vector3D t = v0.normalize();
Vector3D r = Vector3D.crossProduct(v0, Vector3D.crossProduct(p0, v0)).normalize();
Vector3D p1 = new Vector3D(p.getX().getComponent(1),
p.getY().getComponent(1),
p.getZ().getComponent(1));
double dT = Vector3D.dotProduct(p1.subtract(p0), t);
double dR = Vector3D.dotProduct(p1.subtract(p0), r);
minTangential.increment(dT);
maxTangential.increment(dT);
minRadial.increment(dR);
maxRadial.increment(dR);
});
propagator.propagate(twoOrbits.getDate().shiftedBy(Constants.JULIAN_DAY / 8));
Assert.assertEquals(-72525.685, minTangential.getResult(), 1.0e-3);
Assert.assertEquals( 926.046, maxTangential.getResult(), 1.0e-3);
Assert.assertEquals( -92.800, minRadial.getResult(), 1.0e-3);
Assert.assertEquals( 7739.532, maxRadial.getResult(), 1.0e-3);
}
@Test
public void testSameDateCartesian() throws OrekitException {
doTestSameDateCartesian(Decimal64Field.getInstance());
......
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