Tudat/Astrodynamics/TrajectoryDesign/swingbyLegMga1DsmPosition.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 SwingbyLegMga1DsmPosition::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 );
    deltaVSwingby_ = mission_segments::gravityAssist( swingbyBodyGravitationalParameter_,
                                                      departureBodyVelocity_,
                                                      ( *velocityBeforeDepartureBodyPtr_ ),
                                                      velocityAfterDeparture_,
                                                      minimumPericenterRadius_ );
    deltaVDsm_ = ( velocityAfterDsm_ - velocityBeforeDsm_ ).norm( );
    deltaV_ = deltaVSwingby_ + deltaVDsm_;
    deltaV = deltaV_;
}
void SwingbyLegMga1DsmPosition :: 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 ) ; deltaVSwingby_ = mission_segments :: gravityAssist ( swingbyBodyGravitationalParameter_ , departureBodyVelocity_ , ( * velocityBeforeDepartureBodyPtr_ ) , velocityAfterDeparture_ , minimumPericenterRadius_ ) ; deltaVDsm_ = ( velocityAfterDsm_ - velocityBeforeDsm_ ) . norm ( ) ; deltaV_ = deltaVSwingby_ + 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. // Perform a gravity assist at the current body, using the previously obtained velocity and // the properties of the swing-by body. Store the required deltaV. //Calculate the deltaV originating from the DSM. //Calculate the total deltaV of the leg. // Return the deltaV