Tudat/Astrodynamics/Ephemerides/UnitTests/unitTestApproximatePlanetPositions.cpp
//! Test the cicular coplanar function against orbital elements of Mars at JD 2455626.5.
Test the cicular coplanar function against orbital elements of Mars at JD 2455626.5.
Test the cicular coplanar function against orbital elements of Mars at JD 2455626 . 5 .
BOOST_AUTO_TEST_CASE( testCircularCoplannar )
{
    using namespace ephemerides;
    ApproximatePlanetPositionsCircularCoplanar marsEphemeris(
                ApproximatePlanetPositionsBase::mars );
    Eigen::Vector6d marsStateCircularCoplanar
            = marsEphemeris.getCartesianState(
                ( 2455626.5 - basic_astrodynamics::JULIAN_DAY_ON_J2000 ) * physical_constants::JULIAN_DAY );
    Eigen::Vector6d keplerianElementsCircularCoplanar;
    keplerianElementsCircularCoplanar = orbital_element_conversions::
            convertCartesianToKeplerianElements( marsStateCircularCoplanar,
                    marsEphemeris.getSunGravitationalParameter( ) );
    BOOST_CHECK_SMALL( keplerianElementsCircularCoplanar( 1 ), 1e-15 );
    BOOST_CHECK_SMALL( keplerianElementsCircularCoplanar( 2 ),
                       std::numeric_limits< double >::min( ) );
    BOOST_CHECK_SMALL( marsStateCircularCoplanar( 2 ), 2.0e-5 );
    BOOST_CHECK_SMALL( marsStateCircularCoplanar( 5 ),
                       std::numeric_limits< double >::min( ) );
    BOOST_CHECK_EQUAL( marsEphemeris.getReferenceFrameOrientation( ), "J2000" );
    BOOST_CHECK_EQUAL( marsEphemeris.getReferenceFrameOrigin( ), "Sun" );
}
BOOST_AUTO_TEST_CASE ( testCircularCoplannar ) { using namespace ephemerides ; ApproximatePlanetPositionsCircularCoplanar marsEphemeris ( ApproximatePlanetPositionsBase :: mars ) ; Eigen :: Vector6d marsStateCircularCoplanar = marsEphemeris . getCartesianState ( ( 2455626.5 - basic_astrodynamics :: JULIAN_DAY_ON_J2000 ) * physical_constants :: JULIAN_DAY ) ; Eigen :: Vector6d keplerianElementsCircularCoplanar ; keplerianElementsCircularCoplanar = orbital_element_conversions :: convertCartesianToKeplerianElements ( marsStateCircularCoplanar , marsEphemeris . getSunGravitationalParameter ( ) ) ; BOOST_CHECK_SMALL ( keplerianElementsCircularCoplanar ( 1 ) , 1e-15 ) ; BOOST_CHECK_SMALL ( keplerianElementsCircularCoplanar ( 2 ) , std :: numeric_limits < double > :: min ( ) ) ; BOOST_CHECK_SMALL ( marsStateCircularCoplanar ( 2 ) , 2.0e-5 ) ; BOOST_CHECK_SMALL ( marsStateCircularCoplanar ( 5 ) , std :: numeric_limits < double > :: min ( ) ) ; BOOST_CHECK_EQUAL ( marsEphemeris . getReferenceFrameOrientation ( ) , " " ) ; BOOST_CHECK_EQUAL ( marsEphemeris . getReferenceFrameOrigin ( ) , " " ) ; }
Test the cicular coplanar function against orbital elements of Mars at JD 2455626.5.
Test the cicular coplanar function against orbital elements of Mars at JD 2455626 . 5 .
// Compute the Keplerian elements from this ephemeris. // Check the eccentricity, inclination and z-component of velocity and position are 0. // Check that the reference frame properties are as expected.