Class LocalMagneticFieldFrame

  • All Implemented Interfaces:
    LOF

    public class LocalMagneticFieldFrame
    extends Object
    implements LOF
    This class handles a magnetic field variation attitude provider.

    It was designed to be used as a Bdot attitude pointing law which align a specific body axis with Earth magnetic field vector.

    Attitude control thought the magnetic field is called Bdot as it follows the sinusoidal variation of the Earth magnetic field vector, along the orbit. Magnetorquers are used on board to align the instrument, as so the satellite, with the planet magnetic field, producing a sinusoidal torque along the orbit.

    Author:
    Alberto Ferrero, Vincent Cucchietti
    • Constructor Detail

      • LocalMagneticFieldFrame

        public LocalMagneticFieldFrame​(Frame inertialFrame,
                                       GeoMagneticField magneticField,
                                       Frame bodyFrame)
        Constructor with default definition of the local orbital frame:
        • x: Magnetic field
        • y: Completes orthonormal frame
        • z: Cross product of the magnetic field with the orbital momentum
        . BEWARE : Do not use this constructor if it is planned to be used with an equatorial orbit as the magnetic field and orbital momentum vectors will be parallel and cause an error to be thrown
        Parameters:
        inertialFrame - inertial frame in which position-velocity coordinates will be given when computing transform and rotation
        magneticField - Earth magnetic field model
        bodyFrame - body frame related to body shape
      • LocalMagneticFieldFrame

        public LocalMagneticFieldFrame​(Frame inertialFrame,
                                       GeoMagneticField magneticField,
                                       LocalMagneticFieldFrame.LOFBuilderVector lofBuilderVector,
                                       Frame bodyFrame)
        Constructor with custom definition of the local orbital frame:
        • x: Magnetic field
        • y: Completes orthonormal frame
        • z: Cross product of the magnetic field with chosen vector
        For near-polar orbits, it is suggested to use the orbital momentum to define the local orbital frame. However, for near-equatorial orbits, it is advised to use either the position or the velocity.
        Parameters:
        inertialFrame - inertial frame in which position-velocity coordinates will be given when computing transform and rotation
        magneticField - Earth magnetic field model
        lofBuilderVector - vector used to define the local orbital frame
        bodyFrame - body frame related to body shape
    • Method Detail

      • rotationFromInertial

        public <T extends CalculusFieldElement<T>> FieldRotation<T> rotationFromInertial​(Field<T> field,
                                                                                         FieldAbsoluteDate<T> date,
                                                                                         FieldPVCoordinates<T> pv)
        Get the rotation from inertial frame to local orbital frame.

        This rotation does not include any time derivatives. If first time derivatives (i.e. rotation rate) is needed as well, the full LOF.transformFromInertial(FieldAbsoluteDate, FieldPVCoordinates) method must be called and the complete rotation transform must be extracted from it.

        Direction as X axis aligned with magnetic field vector, Y axis aligned with the cross product of the magnetic field vector with chosen vector type.

        BEWARE: In this implementation, the method simply fieldify the normal rotation with given field. Hence all derivatives are lost.

        Specified by:
        rotationFromInertial in interface LOF
        Type Parameters:
        T - type of the field elements
        Parameters:
        field - field to which the elements belong
        date - date of the rotation
        pv - position-velocity of the spacecraft in some inertial frame
        Returns:
        rotation from inertial frame to local orbital frame
      • rotationFromInertial

        public Rotation rotationFromInertial​(AbsoluteDate date,
                                             PVCoordinates pv)
        Get the rotation from inertial frame to local orbital frame.

        This rotation does not include any time derivatives. If first time derivatives (i.e. rotation rate) is needed as well, the full transformFromInertial method must be called and the complete rotation transform must be extracted from it. Direction as X axis aligned with magnetic field vector, Z axis aligned with the cross product of the magnetic field vector with chosen vector type.

        Specified by:
        rotationFromInertial in interface LOF
        Parameters:
        date - date of the rotation
        pv - position-velocity of the spacecraft in some inertial frame
        Returns:
        rotation from inertial frame to local orbital frame
      • getName

        public String getName()
        Get name of the local orbital frame.
        Specified by:
        getName in interface LOF
        Returns:
        name of the local orbital frame
      • getInertialFrame

        public Frame getInertialFrame()
        Get interlai frame.
        Returns:
        inertial frame
      • getMagneticField

        public GeoMagneticField getMagneticField()
        Get geomagnetid field.
        Returns:
        geo magnetic field