Tudat/Astrodynamics/ElectroMagnetism/radiationPressureInterface.cpp
//! Function to update the current value of the radiation pressure
Function to update the current value of the radiation pressure
Function to update the current value of the radiation pressure
void RadiationPressureInterface::updateInterface(
        const double currentTime )
{
    currentTime_ = currentTime;
    currentSolarVector_ = sourcePositionFunction_( ) - targetPositionFunction_( );
    double distanceFromSource = currentSolarVector_.norm( );
    currentRadiationPressure_ = calculateRadiationPressure(
                sourcePower_( ), distanceFromSource );
    double shadowFunction = 1.0;
    double currentShadowFunction = 1.0;
    for( unsigned int i = 0; i < occultingBodyPositions_.size( ); i++ )
    {
        currentShadowFunction *= mission_geometry::computeShadowFunction(
                    sourcePositionFunction_( ), sourceRadius_, occultingBodyPositions_[ i ]( ),
                    occultingBodyRadii_[ i ], targetPositionFunction_( ) );
        if( currentShadowFunction != 1.0 && shadowFunction != 1.0 )
        {
            std::cerr << "Warning, multiple occultation occured in radiation pressure interface, results may be slightly in error" << std::endl;
        }
        shadowFunction *= currentShadowFunction;
    }
    currentRadiationPressure_ *= shadowFunction;
    radiationPressureCoefficient_ = radiationPressureCoefficientFunction_( currentTime );
}
void RadiationPressureInterface :: updateInterface ( const double currentTime ) { currentTime_ = currentTime ; currentSolarVector_ = sourcePositionFunction_ ( ) - targetPositionFunction_ ( ) ; double distanceFromSource = currentSolarVector_ . norm ( ) ; currentRadiationPressure_ = calculateRadiationPressure ( sourcePower_ ( ) , distanceFromSource ) ; double shadowFunction = 1.0 ; double currentShadowFunction = 1.0 ; for ( unsigned int i = 0 ; i < occultingBodyPositions_ . size ( ) ; i ++ ) { currentShadowFunction *= mission_geometry :: computeShadowFunction ( sourcePositionFunction_ ( ) , sourceRadius_ , occultingBodyPositions_ [ i ] ( ) , occultingBodyRadii_ [ i ] , targetPositionFunction_ ( ) ) ; if ( currentShadowFunction != 1.0 && shadowFunction != 1.0 ) { std :: cerr << " " << std :: endl ; } shadowFunction *= currentShadowFunction ; } currentRadiationPressure_ *= shadowFunction ; radiationPressureCoefficient_ = radiationPressureCoefficientFunction_ ( currentTime ) ; }
Function to update the current value of the radiation pressure
Function to update the current value of the radiation pressure
// Calculate current radiation pressure // Calculate total shadowing due to occulting body; note that multiple concurrent // occultations are not completely correctly (prints warning).