Skip to content

Commit

Permalink
Panelled surface radiation pressure working
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Oct 22, 2023
1 parent 9d0d7e8 commit 4ccc1d9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RadiationPressureAccelerationPartial: public AccelerationPartial
RadiationPressureAccelerationPartial(
const std::string acceleratedBody,
const std::string acceleratingBody,
const std::shared_ptr< electromagnetism::RadiationPressureAcceleration > radiationPressureAcceleration,
const std::shared_ptr< electromagnetism::PaneledSourceRadiationPressureAcceleration > radiationPressureAcceleration,
const std::shared_ptr< estimatable_parameters::CustomSingleAccelerationPartialCalculatorSet > customAccelerationPartialSet = nullptr ):
AccelerationPartial( acceleratedBody, acceleratingBody, basic_astrodynamics::custom_acceleration ),
radiationPressureAcceleration_( radiationPressureAcceleration ),
Expand Down Expand Up @@ -248,7 +248,7 @@ class RadiationPressureAccelerationPartial: public AccelerationPartial

protected:

std::shared_ptr< electromagnetism::RadiationPressureAcceleration > radiationPressureAcceleration_;
std::shared_ptr< electromagnetism::PaneledSourceRadiationPressureAcceleration > radiationPressureAcceleration_;

std::shared_ptr< estimatable_parameters::CustomSingleAccelerationPartialCalculatorSet > customAccelerationPartialSet_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ std::shared_ptr< acceleration_partials::AccelerationPartial > createRadiationPre

// Create partial-calculating object.
accelerationPartial = std::make_shared< acceleration_partials::RadiationPressureAccelerationPartial >
( acceleratedBody.first, acceleratingBody.first, radiationPressureAccelerationModel, customPartialCalculator );
( acceleratedBody.first, acceleratingBody.first,
std::dynamic_pointer_cast< PaneledSourceRadiationPressureAcceleration >( radiationPressureAccelerationModel ), customPartialCalculator );

}
return accelerationPartial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ void PanelledRadiationPressurePartial::update( const double currentTime )
currentPartialWrtPosition_ = rotationToInertialFrame * currentPartialWrtPosition_ * rotationToInertialFrame.transpose( );
currentPartialWrtPosition_ /= currentMass;

currentPartialWrtPosition_ += currentAcceleration / currentRadiationPressure * currentRadiationPressurePositionPartial_ * rotationToInertialFrame.transpose( );

// std::cout<<"Total partial: "<<currentPartialWrtPosition_<<std::endl;
currentPartialWrtPosition_ += currentAcceleration / currentRadiationPressure *
( currentRadiationPressurePositionPartial_ * rotationToInertialFrame.transpose( ) );

}
currentTime_ = currentTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE( testCentralGravityPartials )
partialWrtSunGravitationalParameter, std::numeric_limits< double >::epsilon( ) );
}

BOOST_AUTO_TEST_CASE( testRadiationPressureAccelerationPartials )
BOOST_AUTO_TEST_CASE( testCannonballRadiationPressureAccelerationPartials )
{
// Create empty bodies, earth and sun.
std::shared_ptr< Body > vehicle = std::make_shared< Body >( );
Expand Down Expand Up @@ -364,7 +364,6 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAccelerationPartials )
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( testPartialWrtSunPosition,
partialWrtSunPosition, 1.0E-8 );

std::cout<<testPartialWrtSunPosition<<std::endl<<partialWrtSunPosition<<std::endl;
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( testPartialWrtSunVelocity,
partialWrtSunVelocity, std::numeric_limits< double >::epsilon( ) );
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( testPartialWrtVehiclePosition,
Expand Down Expand Up @@ -1463,29 +1462,22 @@ BOOST_AUTO_TEST_CASE( testThrustPartials )
partialWrtEngine2Thrust( 2 ) = 0.0;
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( testPartialWrtEngine2Thrust, partialWrtEngine2Thrust, 1.0E-9 );

std::cout<<"Partial w.r.t. mass (analytical): "<<partialWrtMass.transpose( )<<std::endl;
std::cout<<"Partial w.r.t. mass (numerical): "<<testPartialWrtMass.transpose( )<<std::endl<<std::endl;

std::cout<<"Partial w.r.t. engine 1 thrust (analytical): "<<partialWrtEngine1Thrust.transpose( )<<std::endl;
std::cout<<"Partial w.r.t. engine 1 thrust (numerical): "<<testPartialWrtEngine1Thrust.transpose( )<<std::endl<<std::endl;

std::cout<<"Partial w.r.t. engine 2 thrust (analytical): "<<partialWrtEngine2Thrust.transpose( )<<std::endl;
std::cout<<"Partial w.r.t. engine 2 thrust (numerical): "<<testPartialWrtEngine2Thrust.transpose( )<<std::endl<<std::endl;
std::cout<<std::endl<<std::endl;

bool isPartialChecked = false;
if( i == 0 )
{
for( int j = 0; j < 3; j++ )
{
BOOST_CHECK_EQUAL( partialWrtEngine2Thrust( j ), 0.0 );
isPartialChecked = true;
}
}
// std::cout<<testPartialWrtEngine1Thrust<<std::endl<<std::endl;
// std::cout<<partialWrtEngine1Thrust<<std::endl<<std::endl<<std::endl;

// std::cout<<testPartialWrtEngine2Thrust<<std::endl<<std::endl;
// std::cout<<partialWrtEngine2Thrust<<std::endl<<std::endl<<std::endl;
else
{
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( partialWrtMass, testPartialWrtMass, 1.0E-4 );
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( partialWrtEngine1Thrust, testPartialWrtEngine1Thrust, 1.0E-4 );
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( partialWrtEngine2Thrust, testPartialWrtEngine2Thrust, 1.0E-4 );

}
}
}

Expand Down

0 comments on commit 4ccc1d9

Please sign in to comment.