Tudat/Astrodynamics/BasicAstrodynamics/UnitTests/unitTestConvertMeanAnomalyToEccentricAnomaly.cpp
//! Test 2: Test conversion for valid range of eccentricities.
Test 2: Test conversion for valid range of eccentricities.
Test 2 : Test conversion for valid range of eccentricities .
BOOST_AUTO_TEST_CASE( test_convertMeanAnomalyToEccentricAnomaly_range )
{
    const double arrayOfTestEccentricities [4] = { 0.01671, 0.43582, 0.78514, 0.91525 };
    const double arrayOfTestMeanAnomalies [4] = {
        convertDegreesToRadians( 60.0 ),
        convertDegreesToRadians( 90.0 ),
        convertDegreesToRadians( 120.0 ),
        convertDegreesToRadians( 220.0 ) };
    const double arrayOfReferenceEccentricAnomalies [4] = { 1.06178920406832,
                                                            1.97200731113253,
                                                            2.5392410896466,
                                                            3.51006218528448 };
    for ( int i = 0; i < 4; i++ )
    {
        const double eccentricAnomaly = convertMeanAnomalyToEccentricAnomaly(
                    arrayOfTestEccentricities[ i ], arrayOfTestMeanAnomalies[ i ] );
        BOOST_CHECK_CLOSE_FRACTION( eccentricAnomaly, arrayOfReferenceEccentricAnomalies[ i ],
                                    1.0E-13 );
    }
}
BOOST_AUTO_TEST_CASE ( test_convertMeanAnomalyToEccentricAnomaly_range ) { const double arrayOfTestEccentricities [ 4 ] = { 0.01671 , 0.43582 , 0.78514 , 0.91525 } ; const double arrayOfTestMeanAnomalies [ 4 ] = { convertDegreesToRadians ( 60.0 ) , convertDegreesToRadians ( 90.0 ) , convertDegreesToRadians ( 120.0 ) , convertDegreesToRadians ( 220.0 ) } ; const double arrayOfReferenceEccentricAnomalies [ 4 ] = { 1.06178920406832 , 1.97200731113253 , 2.5392410896466 , 3.51006218528448 } ; for ( int i = 0 ; i < 4 ; i ++ ) { const double eccentricAnomaly = convertMeanAnomalyToEccentricAnomaly ( arrayOfTestEccentricities [ i ] , arrayOfTestMeanAnomalies [ i ] ) ; BOOST_CHECK_CLOSE_FRACTION ( eccentricAnomaly , arrayOfReferenceEccentricAnomalies [ i ] , 1.0E-13 ) ; } }
Test 2: Test conversion for valid range of eccentricities.
Test 2 : Test conversion for valid range of eccentricities .
// Set test values for eccentricity. // Set test values for mean anomaly. // Set reference values for eccentric anomaly. These were obtained using GTOP. // Loop over sets of data. // Compute eccentric anomaly. // Check if computed eccentric anomaly is less than error tolerance.