Tudat/Astrodynamics/TrajectoryDesign/departureLegMga1DsmPosition.cpp
//! Calculate the leg and update the Delta V and the velocity before the next body.
Calculate the leg and update the Delta V and the velocity before the next body.
Calculate the leg and update the Delta V and the velocity before the next body .
void DepartureLegMga1DsmPosition::calculateLeg( Eigen::Vector3d& velocityBeforeArrivalBody,
                                                double& deltaV )
{
    calculateDsmLocation( );
    dsmTime_ = dsmTimeOfFlightFraction_ * timeOfFlight_;
    mission_segments::solveLambertProblemIzzo( departureBodyPosition_, dsmLocation_, dsmTime_,
                                               centralBodyGravitationalParameter_,
                                               velocityAfterDeparture_, velocityBeforeDsm_ );
    mission_segments::solveLambertProblemIzzo( dsmLocation_, arrivalBodyPosition_, timeOfFlight_ -
                                               dsmTime_, centralBodyGravitationalParameter_,
                                               velocityAfterDsm_, velocityBeforeArrivalBody );
    escapeDeltaV_ = mission_segments::computeEscapeOrCaptureDeltaV(
                departureBodyGravitationalParameter_, semiMajorAxis_, eccentricity_,
                ( velocityAfterDeparture_ - departureBodyVelocity_ ).norm( ) );
    deltaVDsm_ = ( velocityAfterDsm_ - velocityBeforeDsm_ ).norm( );
    if( includeDepartureDeltaV_ )
    {
        deltaV_ = escapeDeltaV_ + deltaVDsm_;
    }
    else
    {
        deltaV_ = deltaVDsm_;
    }
    deltaV = deltaV_;
}
void DepartureLegMga1DsmPosition :: calculateLeg ( Eigen :: Vector3d & velocityBeforeArrivalBody , double & deltaV ) { calculateDsmLocation ( ) ; dsmTime_ = dsmTimeOfFlightFraction_ * timeOfFlight_ ; mission_segments :: solveLambertProblemIzzo ( departureBodyPosition_ , dsmLocation_ , dsmTime_ , centralBodyGravitationalParameter_ , velocityAfterDeparture_ , velocityBeforeDsm_ ) ; mission_segments :: solveLambertProblemIzzo ( dsmLocation_ , arrivalBodyPosition_ , timeOfFlight_ - dsmTime_ , centralBodyGravitationalParameter_ , velocityAfterDsm_ , velocityBeforeArrivalBody ) ; escapeDeltaV_ = mission_segments :: computeEscapeOrCaptureDeltaV ( departureBodyGravitationalParameter_ , semiMajorAxis_ , eccentricity_ , ( velocityAfterDeparture_ - departureBodyVelocity_ ) . norm ( ) ) ; deltaVDsm_ = ( velocityAfterDsm_ - velocityBeforeDsm_ ) . norm ( ) ; if ( includeDepartureDeltaV_ ) { deltaV_ = escapeDeltaV_ + deltaVDsm_ ; } else { deltaV_ = deltaVDsm_ ; } deltaV = deltaV_ ; }
Calculate the leg and update the Delta V and the velocity before the next body.
Calculate the leg and update the Delta V and the velocity before the next body .
// Calculate the DSM location. // Calculate the DSM time of application from the time of flight fraction. // Calculate and set the spacecraft velocities after departure, before and after the DSM, and // before arrival using two lambert targeters and all the corresponding positions and flight // times. // Calculate the deltaV originating from the departure maneuver and the DSM. // Calculate the total deltaV of the leg. // Return the deltaV