use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class BoxAndSolarArraySpacecraftTest method testPlaneAbsorption.
@Test
public void testPlaneAbsorption() throws OrekitException {
AbsoluteDate initialDate = propagator.getInitialState().getDate();
CelestialBody sun = CelestialBodyFactory.getSun();
BoxAndSolarArraySpacecraft s = new BoxAndSolarArraySpacecraft(0, 0, 0, sun, 20.0, Vector3D.PLUS_J, 0.0, 1.0, 0.0);
for (double dt = 0; dt < 4000; dt += 60) {
AbsoluteDate date = initialDate.shiftedBy(dt);
SpacecraftState state = propagator.propagate(date);
Vector3D sunDirection = sun.getPVCoordinates(date, state.getFrame()).getPosition().normalize();
Vector3D flux = new Vector3D(-4.56e-6, sunDirection);
Vector3D acceleration = s.radiationPressureAcceleration(state.getDate(), state.getFrame(), state.getPVCoordinates().getPosition(), state.getAttitude().getRotation(), state.getMass(), flux, getRadiationParameters(s));
Vector3D normal = state.getAttitude().getRotation().applyInverseTo(s.getNormal(state.getDate(), state.getFrame(), state.getPVCoordinates().getPosition(), state.getAttitude().getRotation()));
// solar array normal is slightly misaligned with Sun direction due to Sun being out of orbital plane
Assert.assertEquals(15.1, FastMath.toDegrees(Vector3D.angle(sunDirection, normal)), 0.11);
// radiation pressure is exactly opposed to Sun direction as there is only absorption
Assert.assertEquals(180.0, FastMath.toDegrees(Vector3D.angle(acceleration, sunDirection)), 1.0e-3);
}
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class BoxAndSolarArraySpacecraftTest method testNormalOptimalRotationDS.
@Test
public void testNormalOptimalRotationDS() throws OrekitException {
AbsoluteDate initialDate = propagator.getInitialState().getDate();
CelestialBody sun = CelestialBodyFactory.getSun();
BoxAndSolarArraySpacecraft s = new BoxAndSolarArraySpacecraft(0, 0, 0, sun, 20.0, Vector3D.PLUS_J, 0.0, 1.0, 0.0);
DSFactory factory = new DSFactory(1, 2);
for (double dt = 0; dt < 4000; dt += 60) {
AbsoluteDate date = initialDate.shiftedBy(dt);
SpacecraftState state = propagator.propagate(date);
FieldVector3D<DerivativeStructure> normal = s.getNormal(state.getDate(), state.getFrame(), new FieldVector3D<>(factory.getDerivativeField(), state.getPVCoordinates().getPosition()), new FieldRotation<>(factory.getDerivativeField(), state.getAttitude().getRotation()));
Assert.assertEquals(0, FieldVector3D.dotProduct(normal, Vector3D.PLUS_J).getReal(), 1.0e-16);
}
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class BoxAndSolarArraySpacecraftTest method testNormalFixedRateDS.
@Test
public void testNormalFixedRateDS() throws OrekitException {
AbsoluteDate initialDate = propagator.getInitialState().getDate();
CelestialBody sun = CelestialBodyFactory.getSun();
BoxAndSolarArraySpacecraft s = new BoxAndSolarArraySpacecraft(0, 0, 0, sun, 20.0, Vector3D.PLUS_J, initialDate, Vector3D.PLUS_K, 1.0e-3, 0.0, 1.0, 0.0);
DSFactory factory = new DSFactory(1, 2);
for (double dt = 0; dt < 4000; dt += 60) {
AbsoluteDate date = initialDate.shiftedBy(dt);
SpacecraftState state = propagator.propagate(date);
FieldVector3D<DerivativeStructure> normal = s.getNormal(state.getDate(), state.getFrame(), new FieldVector3D<>(factory.getDerivativeField(), state.getPVCoordinates().getPosition()), new FieldRotation<>(factory.getDerivativeField(), state.getAttitude().getRotation()));
Assert.assertEquals(0, FieldVector3D.dotProduct(normal, Vector3D.PLUS_J).getReal(), 1.0e-16);
}
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class BoxAndSolarArraySpacecraftTest method testWrongParameterDrag.
@Test
public void testWrongParameterDrag() throws OrekitException {
SpacecraftState state = propagator.getInitialState();
CelestialBody sun = CelestialBodyFactory.getSun();
BoxAndSolarArraySpacecraft s = new BoxAndSolarArraySpacecraft(0, 0, 0, sun, 20.0, Vector3D.PLUS_J, 0.0, 1.0, 0.0);
try {
s.dragAcceleration(state.getDate(), state.getFrame(), state.getPVCoordinates().getPosition(), state.getAttitude().getRotation(), state.getMass(), 1.0e-6, Vector3D.PLUS_I, getDragParameters(s), "wrong");
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, oe.getSpecifier());
Assert.assertEquals("wrong", (String) oe.getParts()[0]);
}
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class BoxAndSolarArraySpacecraftTest method testNullIllumination.
@Test
public void testNullIllumination() throws OrekitException {
SpacecraftState state = propagator.getInitialState();
CelestialBody sun = CelestialBodyFactory.getSun();
BoxAndSolarArraySpacecraft s = new BoxAndSolarArraySpacecraft(0, 0, 0, sun, 20.0, Vector3D.PLUS_J, 0.0, 1.0, 0.0);
FieldVector3D<DerivativeStructure> a = s.radiationPressureAcceleration(state.getDate(), state.getFrame(), state.getPVCoordinates().getPosition(), state.getAttitude().getRotation(), state.getMass(), new Vector3D(Precision.SAFE_MIN / 2, Vector3D.PLUS_I), getRadiationParameters(s), RadiationSensitive.ABSORPTION_COEFFICIENT);
Assert.assertEquals(0.0, a.getNorm().getReal(), Double.MIN_VALUE);
}
Aggregations