Search in sources :

Example 36 with CelestialBody

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);
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 37 with CelestialBody

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);
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) CelestialBody(org.orekit.bodies.CelestialBody) DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) DSFactory(org.hipparchus.analysis.differentiation.DSFactory) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 38 with CelestialBody

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);
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) CelestialBody(org.orekit.bodies.CelestialBody) DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) DSFactory(org.hipparchus.analysis.differentiation.DSFactory) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 39 with CelestialBody

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]);
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) CelestialBody(org.orekit.bodies.CelestialBody) OrekitException(org.orekit.errors.OrekitException) Test(org.junit.Test)

Example 40 with CelestialBody

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) CelestialBody(org.orekit.bodies.CelestialBody) DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) Test(org.junit.Test)

Aggregations

CelestialBody (org.orekit.bodies.CelestialBody)51 Test (org.junit.Test)43 AbsoluteDate (org.orekit.time.AbsoluteDate)34 SpacecraftState (org.orekit.propagation.SpacecraftState)32 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)27 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)17 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)14 ArrayList (java.util.ArrayList)9 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)7 OrekitException (org.orekit.errors.OrekitException)7 Frame (org.orekit.frames.Frame)7 CartesianOrbit (org.orekit.orbits.CartesianOrbit)7 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)7 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)6 Atmosphere (org.orekit.forces.drag.atmosphere.Atmosphere)6 Orbit (org.orekit.orbits.Orbit)6 DSSTSolarRadiationPressure (org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure)6 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)5 IsotropicRadiationSingleCoefficient (org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient)5 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)5