Tudat/Astrodynamics/MissionSegments/multiRevolutionLambertTargeterIzzo.cpp
//! Compute time-of-flight using Lagrange's equation (for multiple revolutions).
Compute time-of-flight using Lagrange's equation (for multiple revolutions).
Compute time - of - flight using Lagrange ' s equation ( for multiple revolutions ) .
double MultiRevolutionLambertTargeterIzzo::computeTimeOfFlight( const double xParameter )
{
    const double semiMajorAxis = normalizedMinimumEnergySemiMajorAxis
            / ( 1.0 - xParameter * xParameter );
    if ( xParameter < 1.0 )
    {
        const double alphaParameter = 2.0 * std::acos( xParameter );
        double betaParameter;
        if ( isLongway )
        {
            betaParameter = -2.0 * std::asin(
                        std::sqrt( ( normalizedSemiPerimeter - normalizedChord )
                                   / ( 2.0 * semiMajorAxis ) ) );
        }
        else
        {
            betaParameter = 2.0 * std::asin(
                        std::sqrt( ( normalizedSemiPerimeter - normalizedChord )
                                   / ( 2.0 * semiMajorAxis ) ) );
        }
        const double timeOfFlight = semiMajorAxis * std::sqrt( semiMajorAxis ) *
                ( ( alphaParameter - std::sin( alphaParameter ) )
                  - ( betaParameter - std::sin( betaParameter ) )
                  + 2.0 * mathematical_constants::PI
                  * numberOfRevolutions );
        return timeOfFlight;
    }
    else
    {
        const double alphaParameter = 2.0 * boost::math::acosh( xParameter );
        double betaParameter;
        if ( isLongway )
        {
            betaParameter = -2.0 * boost::math::asinh( std::sqrt( ( normalizedSemiPerimeter
                                                                    - normalizedChord )
                                                                  / ( -2.0 * semiMajorAxis ) ) );
        }
        else
        {
            betaParameter = 2.0 * boost::math::asinh( std::sqrt( ( normalizedSemiPerimeter
                                                                   - normalizedChord )
                                                                 / ( -2.0 * semiMajorAxis ) ) );
        }
        const double timeOfFlightLagrange = -semiMajorAxis * std::sqrt( -semiMajorAxis ) *
                ( ( std::sinh( alphaParameter ) - alphaParameter )
                  - ( std::sinh( betaParameter ) - betaParameter ) );
        return timeOfFlightLagrange;
    }
}
double MultiRevolutionLambertTargeterIzzo :: computeTimeOfFlight ( const double xParameter ) { const double semiMajorAxis = normalizedMinimumEnergySemiMajorAxis / ( 1.0 - xParameter * xParameter ) ; if ( xParameter < 1.0 ) { const double alphaParameter = 2.0 * std :: acos ( xParameter ) ; double betaParameter ; if ( isLongway ) { betaParameter = -2.0 * std :: asin ( std :: sqrt ( ( normalizedSemiPerimeter - normalizedChord ) / ( 2.0 * semiMajorAxis ) ) ) ; } else { betaParameter = 2.0 * std :: asin ( std :: sqrt ( ( normalizedSemiPerimeter - normalizedChord ) / ( 2.0 * semiMajorAxis ) ) ) ; } const double timeOfFlight = semiMajorAxis * std :: sqrt ( semiMajorAxis ) * ( ( alphaParameter - std :: sin ( alphaParameter ) ) - ( betaParameter - std :: sin ( betaParameter ) ) + 2.0 * mathematical_constants :: PI * numberOfRevolutions ) ; return timeOfFlight ; } else { const double alphaParameter = 2.0 * boost :: math :: acosh ( xParameter ) ; double betaParameter ; if ( isLongway ) { betaParameter = -2.0 * boost :: math :: asinh ( std :: sqrt ( ( normalizedSemiPerimeter - normalizedChord ) / ( -2.0 * semiMajorAxis ) ) ) ; } else { betaParameter = 2.0 * boost :: math :: asinh ( std :: sqrt ( ( normalizedSemiPerimeter - normalizedChord ) / ( -2.0 * semiMajorAxis ) ) ) ; } const double timeOfFlightLagrange = - semiMajorAxis * std :: sqrt ( - semiMajorAxis ) * ( ( std :: sinh ( alphaParameter ) - alphaParameter ) - ( std :: sinh ( betaParameter ) - betaParameter ) ) ; return timeOfFlightLagrange ; } }
Compute time-of-flight using Lagrange's equation (for multiple revolutions).
Compute time - of - flight using Lagrange ' s equation ( for multiple revolutions ) .
// Determine semi-major axis. // If x < 1, the solution is an ellipse. // Alpha parameter in Lagrange's equation (no explanation available). // Beta parameter in Lagrange's equation (no explanation available). // If long transfer arc. // Otherwise short transfer arc. // Time-of-flight according to Lagrange including multiple revolutions. // Otherwise it is a hyperbola. // Alpha parameter in Lagrange's equation (no explanation available). // Beta parameter in Lagrange's equation (no explanation available). // If long transfer arc. // Otherwise short transfer arc // Time-of-flight according to Lagrange.