Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/secondDegreeGravitationalTorquePartial.cpp
//! Function for calculating the partial of the torque w.r.t. a non-rotational integrated state

Function for calculating the partial of the torque w.r.t. a non-rotational integrated state
Function for calculating the partial of the torque w . r . t . a non - rotational integrated state
void SecondDegreeGravitationalTorquePartial::wrtNonRotationalStateOfAdditionalBody(
        Eigen::Block< Eigen::MatrixXd > partialMatrix,
        const std::pair< std::string, std::string >& stateReferencePoint,
        const propagators::IntegratedStateType integratedStateType )
{
    if( ( stateReferencePoint.first == bodyExertingTorque_ ||
          stateReferencePoint.first == bodyUndergoingTorque_ ) && integratedStateType == propagators::translational_state )
    {
        partialMatrix.block( 0, 0, 3, 3 ) +=
                ( ( stateReferencePoint.first == bodyExertingTorque_ ) ? 1.0 : -1.0 ) *
                ( torqueModel_->getCurrentTorqueMagnitudePremultiplier( ) *
                  ( linear_algebra::getCrossProductMatrix( currentBodyFixedRelativePosition_ ) *
                      torqueModel_->getCurrentInertiaTensorOfRotatingBody( ) -
                      linear_algebra::getCrossProductMatrix( torqueModel_->getCurrentInertiaTensorTimesRelativePositionOfBody( ) ) ) *
                  ( torqueModel_->getCurrentRotationToBodyFixedFrame( ) ).toRotationMatrix( ) -
                  5.0 * torqueModel_->getTorque( ) *
                  torqueModel_->getCurrentRelativePositionOfBodySubjectToTorque( ).normalized( ).transpose( ) /
                  currentBodyFixedRelativePosition_.norm( ) );
    }
}
void SecondDegreeGravitationalTorquePartial :: wrtNonRotationalStateOfAdditionalBody ( Eigen :: Block < Eigen :: MatrixXd > partialMatrix , const std :: pair < std :: string , std :: string > & stateReferencePoint , const propagators :: IntegratedStateType integratedStateType ) { if ( ( stateReferencePoint . first == bodyExertingTorque_ || stateReferencePoint . first == bodyUndergoingTorque_ ) && integratedStateType == propagators :: translational_state ) { partialMatrix . block ( 0 , 0 , 3 , 3 ) += ( ( stateReferencePoint . first == bodyExertingTorque_ ) ? 1.0 : -1.0 ) * ( torqueModel_ -> getCurrentTorqueMagnitudePremultiplier ( ) * ( linear_algebra :: getCrossProductMatrix ( currentBodyFixedRelativePosition_ ) * torqueModel_ -> getCurrentInertiaTensorOfRotatingBody ( ) - linear_algebra :: getCrossProductMatrix ( torqueModel_ -> getCurrentInertiaTensorTimesRelativePositionOfBody ( ) ) ) * ( torqueModel_ -> getCurrentRotationToBodyFixedFrame ( ) ) . toRotationMatrix ( ) - 5.0 * torqueModel_ -> getTorque ( ) * torqueModel_ -> getCurrentRelativePositionOfBodySubjectToTorque ( ) . normalized ( ) . transpose ( ) / currentBodyFixedRelativePosition_ . norm ( ) ) ; } }
Function for calculating the partial of the torque w.r.t.
Function for calculating the partial of the torque w . r . t .