Tudat/Mathematics/NumericalIntegrators/UnitTests/unitTestNumericalIntegrator.cpp
//! Test if the numerical integrator base class is working correctly.
Test if the numerical integrator base class is working correctly.
Test if the numerical integrator base class is working correctly .
BOOST_AUTO_TEST_CASE( testNumberOfStepsUsingNumericalIntegrator )
{
    Eigen::VectorXd initialState = ( Eigen::VectorXd( 4 ) << 0.34, 0.24, 0.76, 0.10 ).finished( );
    {
        BOOST_CHECK( testIntegrateToFunction( 0.0, 0.0, initialState, 10.0 ) );
        BOOST_CHECK( testIntegrateToFunction( 0.0, 10.0, initialState, 10.0 ) );
        BOOST_CHECK( testIntegrateToFunction( 0.0, 20.0, initialState, 10.0 ) );
        BOOST_CHECK( testIntegrateToFunction( 0.0, 30.0, initialState, 10.0 ) );
    }
    {
        BOOST_CHECK( testIntegrateToFunction( 0.0, 10.0, initialState, 2.5 ) );
        BOOST_CHECK( testIntegrateToFunction( 0.0, 10.0, initialState, 3.0 ) );
        BOOST_CHECK( testIntegrateToFunction( 0.0, 10.0, initialState, 3.5 ) );
    }
}
BOOST_AUTO_TEST_CASE ( testNumberOfStepsUsingNumericalIntegrator ) { Eigen :: VectorXd initialState = ( Eigen :: VectorXd ( 4 ) << 0.34 , 0.24 , 0.76 , 0.10 ) . finished ( ) ; { BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 0.0 , initialState , 10.0 ) ) ; BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 10.0 , initialState , 10.0 ) ) ; BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 20.0 , initialState , 10.0 ) ) ; BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 30.0 , initialState , 10.0 ) ) ; } { BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 10.0 , initialState , 2.5 ) ) ; BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 10.0 , initialState , 3.0 ) ) ; BOOST_CHECK ( testIntegrateToFunction ( 0.0 , 10.0 , initialState , 3.5 ) ) ; } }
Test if the numerical integrator base class is working correctly.
Test if the numerical integrator base class is working correctly .
// Set random initial state. // Case 1: test number of steps for different start and end times. // Case 2: test number of steps for different step sizes.