use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class SolarRadiationPressureTest method testGlobalStateJacobianBox.
@Test
public void testGlobalStateJacobianBox() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
double i = FastMath.toRadians(98.7);
double omega = FastMath.toRadians(93.0);
double OMEGA = FastMath.toRadians(15.0 * 22.5);
Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
OrbitType integrationType = OrbitType.CARTESIAN;
double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, integrationType);
NumericalPropagator propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
propagator.setOrbitType(integrationType);
SolarRadiationPressure forceModel = new SolarRadiationPressure(CelestialBodyFactory.getSun(), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, new BoxAndSolarArraySpacecraft(1.5, 2.0, 1.8, CelestialBodyFactory.getSun(), 20.0, Vector3D.PLUS_J, 1.2, 0.7, 0.2));
propagator.addForceModel(forceModel);
SpacecraftState state0 = new SpacecraftState(orbit);
checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 1e3, tolerances[0], 5.0e-4);
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class SolarRadiationPressureTest method doTestLocalJacobianIsotropicClassicalVsFiniteDifferences.
private void doTestLocalJacobianIsotropicClassicalVsFiniteDifferences(double deltaT, double dP, double checkTolerance, boolean print) throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
double i = FastMath.toRadians(98.7);
double omega = FastMath.toRadians(93.0);
double OMEGA = FastMath.toRadians(15.0 * 22.5);
Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
final SolarRadiationPressure forceModel = new SolarRadiationPressure(CelestialBodyFactory.getSun(), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, new IsotropicRadiationClassicalConvention(2.5, 0.7, 0.2));
checkStateJacobianVsFiniteDifferences(new SpacecraftState(orbit.shiftedBy(deltaT)), forceModel, Propagator.DEFAULT_LAW, dP, checkTolerance, print);
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class IodGibbs method estimate.
/**
* Give an initial orbit estimation, assuming Keplerian motion.
* All observations should be from the same location.
*
* @param frame measure frame
* @param r1 position 1 measured in frame
* @param date1 date of measure 1
* @param r2 position 2 measured in frame
* @param date2 date of measure 2
* @param r3 position 3 measured in frame
* @param date3 date of measure 3
* @return an initial orbit estimation
*/
public KeplerianOrbit estimate(final Frame frame, final Vector3D r1, final AbsoluteDate date1, final Vector3D r2, final AbsoluteDate date2, final Vector3D r3, final AbsoluteDate date3) {
// Checks measures are not at the same date
if (date1.equals(date2) || date1.equals(date3) || date2.equals(date3)) {
// throw new OrekitException("The measures are not different!");
}
// Checks measures are in the same plane
final double num = r1.normalize().dotProduct(r2.normalize().crossProduct(r3.normalize()));
final double alpha = FastMath.PI / 2.0 - FastMath.acos(num);
if (FastMath.abs(alpha) > COPLANAR_THRESHOLD) {
// throw something
// throw new OrekitException("Non coplanar points!");
}
final Vector3D D = r1.crossProduct(r2).add(r2.crossProduct(r3).add(r3.crossProduct(r1)));
final Vector3D N = (r2.crossProduct(r3)).scalarMultiply(r1.getNorm()).add((r3.crossProduct(r1)).scalarMultiply(r2.getNorm())).add((r1.crossProduct(r2)).scalarMultiply(r3.getNorm()));
final Vector3D B = D.crossProduct(r2);
final Vector3D S = r1.scalarMultiply(r2.getNorm() - r3.getNorm()).add(r2.scalarMultiply(r3.getNorm() - r1.getNorm()).add(r3.scalarMultiply(r1.getNorm() - r2.getNorm())));
// middle velocity
final double vm = FastMath.sqrt(mu / (N.getNorm() * D.getNorm()));
final Vector3D vlEci = B.scalarMultiply(vm / r2.getNorm()).add(S.scalarMultiply(vm));
// compile a new middle point with position, velocity
final PVCoordinates pv = new PVCoordinates(r2, vlEci);
final AbsoluteDate date = date2;
// compute the equivalent Keplerian orbit
return new KeplerianOrbit(pv, frame, date, mu);
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class IodGooding method propagatePV.
/**
* Propagate a solution (Kepler).
*
* @param P1 initial position vector
* @param V1 initial velocity vector
* @param tau propagation time
* @return final position vector
*/
private Vector3D propagatePV(final Vector3D P1, final Vector3D V1, final double tau) {
final PVCoordinates pv1 = new PVCoordinates(P1, V1);
// create a Keplerian orbit. Assume MU = 1.
final KeplerianOrbit orbit = new KeplerianOrbit(pv1, frame, date1, 1.);
return orbit.shiftedBy(tau).getPVCoordinates().getPosition();
}
use of org.orekit.orbits.KeplerianOrbit in project Orekit by CS-SI.
the class SpacecraftStateTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
double mu = 3.9860047e14;
double ae = 6.378137e6;
double c20 = -1.08263e-3;
double c30 = 2.54e-6;
double c40 = 1.62e-6;
double c50 = 2.3e-7;
double c60 = -5.5e-7;
mass = 2500;
double a = 7187990.1979844316;
double e = 0.5e-4;
double i = 1.7105407051081795;
double omega = 1.9674147913622104;
double OMEGA = FastMath.toRadians(261);
double lv = 0;
AbsoluteDate date = new AbsoluteDate(new DateComponents(2004, 01, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
orbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
attitudeLaw = new BodyCenterPointing(orbit.getFrame(), earth);
propagator = new EcksteinHechlerPropagator(orbit, attitudeLaw, mass, ae, mu, c20, c30, c40, c50, c60);
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
Aggregations