Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/inertialTorquePartial.cpp
//! Function to compute partial of torque w.r.t. spherical harmonic cosine coefficients

Function to compute partial of torque w.r.t. spherical harmonic cosine coefficients
Function to compute partial of torque w . r . t . spherical harmonic cosine coefficients
void InertialTorquePartial::wrtCosineSphericalHarmonicCoefficientsOfCentralBody(
        Eigen::MatrixXd& sphericalHarmonicCoefficientPartial,
        const int c20Index, const int c21Index, const int c22Index )
{
    sphericalHarmonicCoefficientPartial.setZero( );
    if( c20Index >= 0 )
    {
        sphericalHarmonicCoefficientPartial .block( 0, c20Index, 3, 1 ) =
                - basic_mathematics::calculateLegendreGeodesyNormalizationFactor( 2, 0 ) *
                currentAngularVelocityCrossProductMatrix_ * currentInertiaTensorNormalizationFactor_ *
                UNSCALED_INERTIAL_TENSOR_PARTIAL_WRT_C20 * currentAngularVelocityVector_;
    }
    if( c21Index >= 0 )
    {
        sphericalHarmonicCoefficientPartial .block( 0, c21Index, 3, 1 ) =
                - basic_mathematics::calculateLegendreGeodesyNormalizationFactor( 2, 1 ) *
                currentAngularVelocityCrossProductMatrix_ * currentInertiaTensorNormalizationFactor_ *
                UNSCALED_INERTIAL_TENSOR_PARTIAL_WRT_C21 * currentAngularVelocityVector_;
    }
    if( c22Index >= 0 )
    {
        sphericalHarmonicCoefficientPartial .block( 0, c22Index, 3, 1 ) =
                - basic_mathematics::calculateLegendreGeodesyNormalizationFactor( 2, 2 ) *
                currentAngularVelocityCrossProductMatrix_ * currentInertiaTensorNormalizationFactor_ *
                UNSCALED_INERTIAL_TENSOR_PARTIAL_WRT_C22 * currentAngularVelocityVector_;
    }
}
void InertialTorquePartial :: wrtCosineSphericalHarmonicCoefficientsOfCentralBody ( Eigen :: MatrixXd & sphericalHarmonicCoefficientPartial , const int c20Index , const int c21Index , const int c22Index ) { sphericalHarmonicCoefficientPartial . setZero ( ) ; if ( c20Index >= 0 ) { sphericalHarmonicCoefficientPartial . block ( 0 , c20Index , 3 , 1 ) = - basic_mathematics :: calculateLegendreGeodesyNormalizationFactor ( 2 , 0 ) * currentAngularVelocityCrossProductMatrix_ * currentInertiaTensorNormalizationFactor_ * UNSCALED_INERTIAL_TENSOR_PARTIAL_WRT_C20 * currentAngularVelocityVector_ ; } if ( c21Index >= 0 ) { sphericalHarmonicCoefficientPartial . block ( 0 , c21Index , 3 , 1 ) = - basic_mathematics :: calculateLegendreGeodesyNormalizationFactor ( 2 , 1 ) * currentAngularVelocityCrossProductMatrix_ * currentInertiaTensorNormalizationFactor_ * UNSCALED_INERTIAL_TENSOR_PARTIAL_WRT_C21 * currentAngularVelocityVector_ ; } if ( c22Index >= 0 ) { sphericalHarmonicCoefficientPartial . block ( 0 , c22Index , 3 , 1 ) = - basic_mathematics :: calculateLegendreGeodesyNormalizationFactor ( 2 , 2 ) * currentAngularVelocityCrossProductMatrix_ * currentInertiaTensorNormalizationFactor_ * UNSCALED_INERTIAL_TENSOR_PARTIAL_WRT_C22 * currentAngularVelocityVector_ ; } }
Function to compute partial of torque w.r.t.
Function to compute partial of torque w . r . t .