Search in sources :

Example 61 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class AbstractParametricAcceleration method acceleration.

/**
 * {@inheritDoc}
 */
@Override
public Vector3D acceleration(final SpacecraftState state, final double[] parameters) throws OrekitException {
    final Vector3D inertialDirection;
    if (isInertial) {
        // the acceleration direction is already defined in the inertial frame
        inertialDirection = direction;
    } else {
        final Attitude attitude;
        if (attitudeOverride == null) {
            // the acceleration direction is defined in spacecraft frame as set by the propagator
            attitude = state.getAttitude();
        } else {
            // the acceleration direction is defined in a dedicated frame
            attitude = attitudeOverride.getAttitude(state.getOrbit(), state.getDate(), state.getFrame());
        }
        inertialDirection = attitude.getRotation().applyInverseTo(direction);
    }
    return new Vector3D(signedAmplitude(state, parameters), inertialDirection);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Attitude(org.orekit.attitudes.Attitude) FieldAttitude(org.orekit.attitudes.FieldAttitude)

Example 62 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class Atmosphere method getVelocity.

/**
 * Get the inertial velocity of atmosphere molecules.
 * <p>By default, atmosphere is supposed to have a null
 * velocity in the central body frame.</p>
 *
 * @param date current date
 * @param position current position in frame
 * @param frame the frame in which is defined the position
 * @return velocity (m/s) (defined in the same frame as the position)
 * @exception OrekitException if some conversion cannot be performed
 */
default Vector3D getVelocity(AbsoluteDate date, Vector3D position, Frame frame) throws OrekitException {
    final Transform bodyToFrame = getFrame().getTransformTo(frame, date);
    final Vector3D posInBody = bodyToFrame.getInverse().transformPosition(position);
    final PVCoordinates pvBody = new PVCoordinates(posInBody, Vector3D.ZERO);
    final PVCoordinates pvFrame = bodyToFrame.transformPVCoordinates(pvBody);
    return pvFrame.getVelocity();
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) Transform(org.orekit.frames.Transform)

Example 63 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class BoxAndSolarArraySpacecraft method radiationPressureAcceleration.

/**
 * {@inheritDoc}
 */
@Override
public Vector3D radiationPressureAcceleration(final AbsoluteDate date, final Frame frame, final Vector3D position, final Rotation rotation, final double mass, final Vector3D flux, final double[] parameters) throws OrekitException {
    if (flux.getNormSq() < Precision.SAFE_MIN) {
        // null illumination (we are probably in umbra)
        return Vector3D.ZERO;
    }
    // radiation flux in spacecraft frame
    final Vector3D fluxSat = rotation.applyTo(flux);
    // solar array contribution
    Vector3D normal = getNormal(date, frame, position, rotation);
    double dot = Vector3D.dotProduct(normal, fluxSat);
    if (dot > 0) {
        // the solar array is illuminated backward,
        // fix signs to compute contribution correctly
        dot = -dot;
        normal = normal.negate();
    }
    Vector3D force = facetRadiationAcceleration(normal, solarArrayArea, fluxSat, dot, parameters);
    // body facets contribution
    for (final Facet bodyFacet : facets) {
        normal = bodyFacet.getNormal();
        dot = Vector3D.dotProduct(normal, fluxSat);
        if (dot < 0) {
            // the facet intercepts the incoming flux
            force = force.add(facetRadiationAcceleration(normal, bodyFacet.getArea(), fluxSat, dot, parameters));
        }
    }
    // convert to inertial frame
    return rotation.applyInverseTo(new Vector3D(1.0 / mass, force));
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D)

Example 64 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class BoxAndSolarArraySpacecraft method dragAcceleration.

/**
 * {@inheritDoc}
 */
@Override
public Vector3D dragAcceleration(final AbsoluteDate date, final Frame frame, final Vector3D position, final Rotation rotation, final double mass, final double density, final Vector3D relativeVelocity, final double[] parameters) throws OrekitException {
    final double dragCoeff = parameters[0];
    final double liftRatio = liftParameterDriver == null ? 0.0 : parameters[1];
    // relative velocity in spacecraft frame
    final double vNorm2 = relativeVelocity.getNormSq();
    final double vNorm = FastMath.sqrt(vNorm2);
    final Vector3D vDir = rotation.applyTo(relativeVelocity.scalarMultiply(1.0 / vNorm));
    final double coeff = density * dragCoeff * vNorm2 / (2.0 * mass);
    final double oMr = 1 - liftRatio;
    // solar array contribution
    final Vector3D frontNormal = getNormal(date, frame, position, rotation);
    final double s = coeff * solarArrayArea * Vector3D.dotProduct(frontNormal, vDir);
    Vector3D acceleration = new Vector3D(oMr * FastMath.abs(s), vDir, liftRatio * s * 2, frontNormal);
    // body facets contribution
    for (final Facet facet : facets) {
        final double dot = Vector3D.dotProduct(facet.getNormal(), vDir);
        if (dot < 0) {
            // the facet intercepts the incoming flux
            final double f = coeff * facet.getArea() * dot;
            acceleration = new Vector3D(1, acceleration, oMr * FastMath.abs(f), vDir, liftRatio * f * 2, facet.getNormal());
        }
    }
    // convert back to inertial frame
    return rotation.applyInverseTo(acceleration);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D)

Example 65 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class DragForce method acceleration.

/**
 * {@inheritDoc}
 */
@Override
public Vector3D acceleration(final SpacecraftState s, final double[] parameters) throws OrekitException {
    final AbsoluteDate date = s.getDate();
    final Frame frame = s.getFrame();
    final Vector3D position = s.getPVCoordinates().getPosition();
    final double rho = atmosphere.getDensity(date, position, frame);
    final Vector3D vAtm = atmosphere.getVelocity(date, position, frame);
    final Vector3D relativeVelocity = vAtm.subtract(s.getPVCoordinates().getVelocity());
    return spacecraft.dragAcceleration(date, frame, position, s.getAttitude().getRotation(), s.getMass(), rho, relativeVelocity, parameters);
}
Also used : Frame(org.orekit.frames.Frame) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)750 Test (org.junit.Test)466 AbsoluteDate (org.orekit.time.AbsoluteDate)323 PVCoordinates (org.orekit.utils.PVCoordinates)280 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)259 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)187 SpacecraftState (org.orekit.propagation.SpacecraftState)152 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)124 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)119 Frame (org.orekit.frames.Frame)115 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)105 Orbit (org.orekit.orbits.Orbit)100 GeodeticPoint (org.orekit.bodies.GeodeticPoint)84 OrekitException (org.orekit.errors.OrekitException)83 CartesianOrbit (org.orekit.orbits.CartesianOrbit)75 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)68 DateComponents (org.orekit.time.DateComponents)67 Transform (org.orekit.frames.Transform)61 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)59 CircularOrbit (org.orekit.orbits.CircularOrbit)59