Tudat/Astrodynamics/Aerodynamics/UnitTests/unitTestNRLMSISE00Atmosphere.cpp
//! Perform NRLMSISE-00 test of get functions.
//  Check the consistency between full output and get parameter output functions.
Perform NRLMSISE-00 test of get functions.
Check the consistency between full output and get parameter output functions.
Perform NRLMSISE - 00 test of get functions . Check the consistency between full output and get parameter output functions .
BOOST_AUTO_TEST_CASE( testNRLMSISE00AtmosphereTestFunctions )
{
    double tolerance = 1.0E-18;
    NRLMSISE00Atmosphere model( std::bind( &function, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, false, false ) );
    data = gen_data;
    std::vector< double > input = gen_input;
    std::pair< std::vector< double >, std::vector< double > > output
            = model.getFullOutput( input[ 0 ], input[ 1 ], input[ 2 ], input[ 3 ] );
    double density1 = output.first[ 5 ] * 1000.0;
    double temperature1 = output.second[ 1 ];
    double density2 = model.getDensity( input[ 0 ], input[ 1 ], input[ 2 ], input[ 3 ] );
    double temperature2 = model.getTemperature( input[ 0 ], input[ 1 ], input[ 2 ], input[ 3 ] );
    BOOST_CHECK_CLOSE_FRACTION( density1, density2, tolerance );
    BOOST_CHECK_CLOSE_FRACTION( temperature1, temperature2, tolerance );
}
BOOST_AUTO_TEST_CASE ( testNRLMSISE00AtmosphereTestFunctions ) { double tolerance = 1.0E-18 ; NRLMSISE00Atmosphere model ( std :: bind ( & function , std :: placeholders :: _1 , std :: placeholders :: _2 , std :: placeholders :: _3 , std :: placeholders :: _4 , false , false ) ) ; data = gen_data ; std :: vector < double > input = gen_input ; std :: pair < std :: vector < double > , std :: vector < double > > output = model . getFullOutput ( input [ 0 ] , input [ 1 ] , input [ 2 ] , input [ 3 ] ) ; double density1 = output . first [ 5 ] * 1000.0 ; double temperature1 = output . second [ 1 ] ; double density2 = model . getDensity ( input [ 0 ] , input [ 1 ] , input [ 2 ] , input [ 3 ] ) ; double temperature2 = model . getTemperature ( input [ 0 ] , input [ 1 ] , input [ 2 ] , input [ 3 ] ) ; BOOST_CHECK_CLOSE_FRACTION ( density1 , density2 , tolerance ) ; BOOST_CHECK_CLOSE_FRACTION ( temperature1 , temperature2 , tolerance ) ; }
Perform NRLMSISE-00 test of get functions.
Perform NRLMSISE - 00 test of get functions .
// Define tolerance for equality // Create the model // Create local copy of input and define variations // Define variations from the standard case // First case is the default case // Get full output and extract density and temperature // Get density and temperature from functions // Check densities and temperatures.