Skip to content

Commit

Permalink
Albedo/IR numerical partials also working
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Oct 23, 2023
1 parent f781174 commit 5bb8b05
Show file tree
Hide file tree
Showing 4 changed files with 1,540 additions and 1,532 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ std::vector< std::shared_ptr< orbit_determination::TidalLoveNumberPartialInterfa
const std::string& acceleratingBodyName );


std::shared_ptr< estimatable_parameters::NumericalAccelerationPartialSettings > getDefaultPanelledSurfaceRadiationPressurePartialSettings(
const std::string bodyUndergoingAcceleration,
const std::string bodyExertingAcceleration );

template< typename InitialStateParameterType = double >
std::shared_ptr< acceleration_partials::AccelerationPartial > createRadiationPressureAccelerationPartial(
std::shared_ptr< electromagnetism::RadiationPressureAcceleration > radiationPressureAccelerationModel,
Expand Down Expand Up @@ -216,16 +220,16 @@ std::shared_ptr< acceleration_partials::AccelerationPartial > createRadiationPre
throw std::runtime_error( "Error when creating custom partials for non-isotropic source radiation pressure; no estimated parameters found" );
}

customPartialCalculator = createCustomAccelerationPartial< InitialStateParameterType >(
parametersToEstimate, radiationPressureAccelerationModel, acceleratedBody, acceleratingBody, bodies );
if( customPartialCalculator == nullptr )
{
for( unsigned int i = 0; i < parametersToEstimate->getEstimatedInitialStateParameters( ).size( ); i++ )
{
parametersToEstimate->getEstimatedInitialStateParameters( ).at( i )->setCustomPartialSettings(
std::make_shared< estimatable_parameters::NumericalAccelerationPartialSettings >(
( Eigen::VectorXd( 6 ) << 10.0, 10.0, 10.0, 1.0E-3, 1.0E-3, 1.0E-3 ).finished( ),
acceleratedBody.first, acceleratingBody.first, basic_astrodynamics::radiation_pressure ) );
if( parametersToEstimate->getEstimatedInitialStateParameters( ).at( i )->getCustomPartialSettings( ) == nullptr )
{
parametersToEstimate->getEstimatedInitialStateParameters( ).at( i )->setCustomPartialSettings(
getDefaultPanelledSurfaceRadiationPressurePartialSettings( acceleratedBody.first, acceleratingBody.first ) );
}

}
customPartialCalculator = createCustomAccelerationPartial< InitialStateParameterType >(
parametersToEstimate, radiationPressureAccelerationModel, acceleratedBody, acceleratingBody, bodies );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ RadiationPressureAccelerationPartial::RadiationPressureAccelerationPartial(
currentPartialWrtUndergoingState_.setZero( );
currentPartialWrtExertingState_.setZero( );

std::cout<<"Initial state partials "<<std::endl;
for( auto it : customAccelerationPartialSet->customInitialStatePartials_ )
{
std::cout<<"Entries: "<<it.first.first<<" "<<it.first.second.first<<" "<<it.first.second.second<<std::endl;
}
estimatable_parameters::EstimatebleParameterIdentifier undergoingBodyIdentifier =
std::make_pair( estimatable_parameters::initial_body_state, std::make_pair( acceleratedBody, "" ) );
if( customAccelerationPartialSet->customInitialStatePartials_.count( undergoingBodyIdentifier ) > 0 )
Expand All @@ -52,10 +47,8 @@ void RadiationPressureAccelerationPartial::update( const double currentTime )
{
radiationPressureAcceleration_->updateMembers( currentTime );

std::cout<<currentTime<<" "<<currentTime_<<std::endl;
if( !( currentTime_ == currentTime ) )
{
std::cout<<"Partials "<<bodyUndergoingPositionPartial_<<" "<<bodyExertingPositionPartial_<<std::endl;
if( bodyUndergoingPositionPartial_ != nullptr )
{
currentPartialWrtUndergoingState_ = bodyUndergoingPositionPartial_->computePartial(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ std::vector< std::shared_ptr< orbit_determination::TidalLoveNumberPartialInterfa
}


std::shared_ptr< estimatable_parameters::NumericalAccelerationPartialSettings > getDefaultPanelledSurfaceRadiationPressurePartialSettings(
const std::string bodyUndergoingAcceleration,
const std::string bodyExertingAcceleration )
{
return std::make_shared< estimatable_parameters::NumericalAccelerationPartialSettings >(
( Eigen::VectorXd( 6 ) << 100.0, 100.0, 100.0, 1.0E-3, 1.0E-3, 1.0E-3 ).finished( ),
bodyUndergoingAcceleration, bodyExertingAcceleration, basic_astrodynamics::radiation_pressure );
}

}

}
Loading

0 comments on commit 5bb8b05

Please sign in to comment.