Search in sources :

Example 21 with TimeStampedPVCoordinates

use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.

the class EquinoctialOrbit method initPVCoordinates.

/**
 * {@inheritDoc}
 */
protected TimeStampedPVCoordinates initPVCoordinates() {
    // position and velocity
    computePVWithoutA();
    // acceleration
    final double r2 = partialPV.getPosition().getNormSq();
    final Vector3D keplerianAcceleration = new Vector3D(-getMu() / (r2 * FastMath.sqrt(r2)), partialPV.getPosition());
    final Vector3D acceleration = hasDerivatives() ? keplerianAcceleration.add(nonKeplerianAcceleration()) : keplerianAcceleration;
    return new TimeStampedPVCoordinates(getDate(), partialPV.getPosition(), partialPV.getVelocity(), acceleration);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates)

Example 22 with TimeStampedPVCoordinates

use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.

the class EquinoctialOrbit method shiftedBy.

/**
 * {@inheritDoc}
 */
public EquinoctialOrbit shiftedBy(final double dt) {
    // use Keplerian-only motion
    final EquinoctialOrbit keplerianShifted = new EquinoctialOrbit(a, ex, ey, hx, hy, getLM() + getKeplerianMeanMotion() * dt, PositionAngle.MEAN, getFrame(), getDate().shiftedBy(dt), getMu());
    if (hasDerivatives()) {
        // extract non-Keplerian acceleration from first time derivatives
        final Vector3D nonKeplerianAcceleration = nonKeplerianAcceleration();
        // add quadratic effect of non-Keplerian acceleration to Keplerian-only shift
        keplerianShifted.computePVWithoutA();
        final Vector3D fixedP = new Vector3D(1, keplerianShifted.partialPV.getPosition(), 0.5 * dt * dt, nonKeplerianAcceleration);
        final double fixedR2 = fixedP.getNormSq();
        final double fixedR = FastMath.sqrt(fixedR2);
        final Vector3D fixedV = new Vector3D(1, keplerianShifted.partialPV.getVelocity(), dt, nonKeplerianAcceleration);
        final Vector3D fixedA = new Vector3D(-getMu() / (fixedR2 * fixedR), keplerianShifted.partialPV.getPosition(), 1, nonKeplerianAcceleration);
        // build a new orbit, taking non-Keplerian acceleration into account
        return new EquinoctialOrbit(new TimeStampedPVCoordinates(keplerianShifted.getDate(), fixedP, fixedV, fixedA), keplerianShifted.getFrame(), keplerianShifted.getMu());
    } else {
        // Keplerian-only motion is all we can do
        return keplerianShifted;
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates)

Example 23 with TimeStampedPVCoordinates

use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.

the class KeplerianOrbit method shiftedBy.

/**
 * {@inheritDoc}
 */
public KeplerianOrbit shiftedBy(final double dt) {
    // use Keplerian-only motion
    final KeplerianOrbit keplerianShifted = new KeplerianOrbit(a, e, i, pa, raan, getMeanAnomaly() + getKeplerianMeanMotion() * dt, PositionAngle.MEAN, getFrame(), getDate().shiftedBy(dt), getMu());
    if (hasDerivatives()) {
        // extract non-Keplerian acceleration from first time derivatives
        final Vector3D nonKeplerianAcceleration = nonKeplerianAcceleration();
        // add quadratic effect of non-Keplerian acceleration to Keplerian-only shift
        keplerianShifted.computePVWithoutA();
        final Vector3D fixedP = new Vector3D(1, keplerianShifted.partialPV.getPosition(), 0.5 * dt * dt, nonKeplerianAcceleration);
        final double fixedR2 = fixedP.getNormSq();
        final double fixedR = FastMath.sqrt(fixedR2);
        final Vector3D fixedV = new Vector3D(1, keplerianShifted.partialPV.getVelocity(), dt, nonKeplerianAcceleration);
        final Vector3D fixedA = new Vector3D(-getMu() / (fixedR2 * fixedR), keplerianShifted.partialPV.getPosition(), 1, nonKeplerianAcceleration);
        // build a new orbit, taking non-Keplerian acceleration into account
        return new KeplerianOrbit(new TimeStampedPVCoordinates(keplerianShifted.getDate(), fixedP, fixedV, fixedA), keplerianShifted.getFrame(), keplerianShifted.getMu());
    } else {
        // Keplerian-only motion is all we can do
        return keplerianShifted;
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates)

Example 24 with TimeStampedPVCoordinates

use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.

the class CircularOrbit method initPVCoordinates.

/**
 * {@inheritDoc}
 */
protected TimeStampedPVCoordinates initPVCoordinates() {
    // position and velocity
    computePVWithoutA();
    // acceleration
    final double r2 = partialPV.getPosition().getNormSq();
    final Vector3D keplerianAcceleration = new Vector3D(-getMu() / (r2 * FastMath.sqrt(r2)), partialPV.getPosition());
    final Vector3D acceleration = hasDerivatives() ? keplerianAcceleration.add(nonKeplerianAcceleration()) : keplerianAcceleration;
    return new TimeStampedPVCoordinates(getDate(), partialPV.getPosition(), partialPV.getVelocity(), acceleration);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates)

Example 25 with TimeStampedPVCoordinates

use of org.orekit.utils.TimeStampedPVCoordinates in project Orekit by CS-SI.

the class CircularOrbit method shiftedBy.

/**
 * {@inheritDoc}
 */
public CircularOrbit shiftedBy(final double dt) {
    // use Keplerian-only motion
    final CircularOrbit keplerianShifted = new CircularOrbit(a, ex, ey, i, raan, getAlphaM() + getKeplerianMeanMotion() * dt, PositionAngle.MEAN, getFrame(), getDate().shiftedBy(dt), getMu());
    if (hasDerivatives()) {
        // extract non-Keplerian acceleration from first time derivatives
        final Vector3D nonKeplerianAcceleration = nonKeplerianAcceleration();
        // add quadratic effect of non-Keplerian acceleration to Keplerian-only shift
        keplerianShifted.computePVWithoutA();
        final Vector3D fixedP = new Vector3D(1, keplerianShifted.partialPV.getPosition(), 0.5 * dt * dt, nonKeplerianAcceleration);
        final double fixedR2 = fixedP.getNormSq();
        final double fixedR = FastMath.sqrt(fixedR2);
        final Vector3D fixedV = new Vector3D(1, keplerianShifted.partialPV.getVelocity(), dt, nonKeplerianAcceleration);
        final Vector3D fixedA = new Vector3D(-getMu() / (fixedR2 * fixedR), keplerianShifted.partialPV.getPosition(), 1, nonKeplerianAcceleration);
        // build a new orbit, taking non-Keplerian acceleration into account
        return new CircularOrbit(new TimeStampedPVCoordinates(keplerianShifted.getDate(), fixedP, fixedV, fixedA), keplerianShifted.getFrame(), keplerianShifted.getMu());
    } else {
        // Keplerian-only motion is all we can do
        return keplerianShifted;
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates)

Aggregations

TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)103 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)64 Test (org.junit.Test)50 AbsoluteDate (org.orekit.time.AbsoluteDate)48 SpacecraftState (org.orekit.propagation.SpacecraftState)36 Frame (org.orekit.frames.Frame)27 ArrayList (java.util.ArrayList)24 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)23 Transform (org.orekit.frames.Transform)22 CartesianOrbit (org.orekit.orbits.CartesianOrbit)20 Orbit (org.orekit.orbits.Orbit)19 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)18 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)17 PVCoordinates (org.orekit.utils.PVCoordinates)17 OrekitException (org.orekit.errors.OrekitException)15 BoundedPropagator (org.orekit.propagation.BoundedPropagator)12 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)11 CircularOrbit (org.orekit.orbits.CircularOrbit)11 Propagator (org.orekit.propagation.Propagator)11 FieldTransform (org.orekit.frames.FieldTransform)10