Search in sources :

Example 1 with SimpleExponentialAtmosphere

use of org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere in project Orekit by CS-SI.

the class JacobianPropagatorConverterTest method setUp.

@Before
public void setUp() throws OrekitException, IOException, ParseException {
    Utils.setDataRoot("regular-data:potential/shm-format");
    gravity = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getNormalizedProvider(2, 0));
    mu = gravity.getParameterDriver(NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT).getValue();
    dP = 1.0;
    // use a orbit that comes close to Earth so the drag coefficient has an effect
    final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6).normalize().scalarMultiply(Constants.WGS84_EARTH_EQUATORIAL_RADIUS + 300e3);
    final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
    final AbsoluteDate initDate = new AbsoluteDate(2010, 10, 10, 10, 10, 10.0, TimeScalesFactory.getUTC());
    orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    earth.setAngularThreshold(1.e-7);
    atmosphere = new SimpleExponentialAtmosphere(earth, 0.0004, 42000.0, 7500.0);
    final double dragCoef = 2.0;
    crossSection = 25.0;
    drag = new DragForce(atmosphere, new IsotropicDrag(crossSection, dragCoef));
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) DragForce(org.orekit.forces.drag.DragForce) PVCoordinates(org.orekit.utils.PVCoordinates) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) AbsoluteDate(org.orekit.time.AbsoluteDate) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) Before(org.junit.Before)

Example 2 with SimpleExponentialAtmosphere

use of org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere in project Orekit by CS-SI.

the class DragForceTest method testIssue229.

@Test
public void testIssue229() throws OrekitException {
    AbsoluteDate initialDate = new AbsoluteDate(2004, 1, 1, 0, 0, 0., TimeScalesFactory.getUTC());
    Frame frame = FramesFactory.getEME2000();
    double rpe = 160.e3 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS;
    double rap = 2000.e3 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS;
    double inc = FastMath.toRadians(0.);
    double aop = FastMath.toRadians(0.);
    double raan = FastMath.toRadians(0.);
    double mean = FastMath.toRadians(180.);
    double mass = 100.;
    KeplerianOrbit orbit = new KeplerianOrbit(0.5 * (rpe + rap), (rap - rpe) / (rpe + rap), inc, aop, raan, mean, PositionAngle.MEAN, frame, initialDate, Constants.EIGEN5C_EARTH_MU);
    IsotropicDrag shape = new IsotropicDrag(10., 2.2);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    BodyShape earthShape = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
    Atmosphere atmosphere = new SimpleExponentialAtmosphere(earthShape, 2.6e-10, 200000, 26000);
    double[][] tolerance = NumericalPropagator.tolerances(0.1, orbit, OrbitType.CARTESIAN);
    AbstractIntegrator integrator = new DormandPrince853Integrator(1.0e-3, 300, tolerance[0], tolerance[1]);
    NumericalPropagator propagator = new NumericalPropagator(integrator);
    propagator.setOrbitType(OrbitType.CARTESIAN);
    propagator.setMu(orbit.getMu());
    propagator.addForceModel(new DragForce(atmosphere, shape));
    PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
    propagator.setInitialState(partials.setInitialJacobians(new SpacecraftState(orbit, mass)));
    SpacecraftState state = propagator.propagate(new AbsoluteDate(2004, 1, 1, 1, 30, 0., TimeScalesFactory.getUTC()));
    double delta = 0.1;
    Orbit shifted = new CartesianOrbit(new TimeStampedPVCoordinates(orbit.getDate(), orbit.getPVCoordinates().getPosition().add(new Vector3D(delta, 0, 0)), orbit.getPVCoordinates().getVelocity()), orbit.getFrame(), orbit.getMu());
    propagator.setInitialState(partials.setInitialJacobians(new SpacecraftState(shifted, mass)));
    SpacecraftState newState = propagator.propagate(new AbsoluteDate(2004, 1, 1, 1, 30, 0., TimeScalesFactory.getUTC()));
    double[] dPVdX = new double[] { (newState.getPVCoordinates().getPosition().getX() - state.getPVCoordinates().getPosition().getX()) / delta, (newState.getPVCoordinates().getPosition().getY() - state.getPVCoordinates().getPosition().getY()) / delta, (newState.getPVCoordinates().getPosition().getZ() - state.getPVCoordinates().getPosition().getZ()) / delta, (newState.getPVCoordinates().getVelocity().getX() - state.getPVCoordinates().getVelocity().getX()) / delta, (newState.getPVCoordinates().getVelocity().getY() - state.getPVCoordinates().getVelocity().getY()) / delta, (newState.getPVCoordinates().getVelocity().getZ() - state.getPVCoordinates().getVelocity().getZ()) / delta };
    double[][] dYdY0 = new double[6][6];
    partials.getMapper().getStateJacobian(state, dYdY0);
    for (int i = 0; i < 6; ++i) {
        Assert.assertEquals(dPVdX[i], dYdY0[i][0], 6.2e-6 * FastMath.abs(dPVdX[i]));
    }
}
Also used : Frame(org.orekit.frames.Frame) CartesianOrbit(org.orekit.orbits.CartesianOrbit) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) BodyShape(org.orekit.bodies.BodyShape) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) PartialDerivativesEquations(org.orekit.propagation.numerical.PartialDerivativesEquations) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) Atmosphere(org.orekit.forces.drag.atmosphere.Atmosphere) AbstractIntegrator(org.hipparchus.ode.AbstractIntegrator) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 3 with SimpleExponentialAtmosphere

use of org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere in project Orekit by CS-SI.

the class SimpleExponentialAtmosphereTest method testExpAtmosphere.

@Test
public void testExpAtmosphere() throws OrekitException {
    Vector3D posInEME2000 = new Vector3D(10000, Vector3D.PLUS_I);
    AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    SimpleExponentialAtmosphere atm = new SimpleExponentialAtmosphere(new OneAxisEllipsoid(Utils.ae, 1.0 / 298.257222101, itrf), 0.0004, 42000.0, 7500.0);
    Vector3D vel = atm.getVelocity(date, posInEME2000, FramesFactory.getEME2000());
    Transform toBody = FramesFactory.getEME2000().getTransformTo(itrf, date);
    Vector3D test = Vector3D.crossProduct(toBody.getRotationRate(), posInEME2000);
    test = test.subtract(vel);
    Assert.assertEquals(0, test.getNorm(), 2.9e-5);
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Transform(org.orekit.frames.Transform) AbsoluteDate(org.orekit.time.AbsoluteDate) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) Test(org.junit.Test)

Example 4 with SimpleExponentialAtmosphere

use of org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere in project Orekit by CS-SI.

the class NumericalConverterTest method setUp.

@Before
public void setUp() throws OrekitException, IOException, ParseException {
    Utils.setDataRoot("regular-data:potential/shm-format");
    gravity = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getNormalizedProvider(2, 0));
    mu = gravity.getParameterDriver(NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT).getValue();
    minStep = 1.0;
    maxStep = 600.0;
    dP = 10.0;
    // use a orbit that comes close to Earth so the drag coefficient has an effect
    final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6).normalize().scalarMultiply(Constants.WGS84_EARTH_EQUATORIAL_RADIUS + 300e3);
    final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
    final AbsoluteDate initDate = new AbsoluteDate(2010, 10, 10, 10, 10, 10.0, TimeScalesFactory.getUTC());
    orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
    final double[][] tol = NumericalPropagator.tolerances(dP, orbit, OrbitType.CARTESIAN);
    propagator = new NumericalPropagator(new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]));
    propagator.setInitialState(new SpacecraftState(orbit));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    earth.setAngularThreshold(1.e-7);
    atmosphere = new SimpleExponentialAtmosphere(earth, 0.0004, 42000.0, 7500.0);
    final double dragCoef = 2.0;
    crossSection = 10.0;
    drag = new DragForce(atmosphere, new IsotropicDrag(crossSection, dragCoef));
    propagator.addForceModel(gravity);
    propagator.addForceModel(drag);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) DragForce(org.orekit.forces.drag.DragForce) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) Before(org.junit.Before)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)4 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)4 SimpleExponentialAtmosphere (org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere)4 AbsoluteDate (org.orekit.time.AbsoluteDate)4 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)2 Before (org.junit.Before)2 Test (org.junit.Test)2 DragForce (org.orekit.forces.drag.DragForce)2 IsotropicDrag (org.orekit.forces.drag.IsotropicDrag)2 HolmesFeatherstoneAttractionModel (org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)2 Frame (org.orekit.frames.Frame)2 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)2 SpacecraftState (org.orekit.propagation.SpacecraftState)2 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)2 PVCoordinates (org.orekit.utils.PVCoordinates)2 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)1 AbstractIntegrator (org.hipparchus.ode.AbstractIntegrator)1 BodyShape (org.orekit.bodies.BodyShape)1 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)1 Atmosphere (org.orekit.forces.drag.atmosphere.Atmosphere)1