Skip to content

Commit

Permalink
Playing with ODF-based fit
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Nov 8, 2023
1 parent 90d7193 commit 654d500
Show file tree
Hide file tree
Showing 10 changed files with 420 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ class RadiationPressureAccelerationPartial: public AccelerationPartial
customAccelerationPartialSet_->customDoubleParameterPartials_.at( parameter->getParameterName() ) );
parameterSize = 1;
}
else if( parameter->getParameterName( ).first == estimatable_parameters::radiation_pressure_coefficient &&
parameter->getParameterName( ).second.first == acceleratedBody_ )
{
if ( std::dynamic_pointer_cast<electromagnetism::CannonballRadiationPressureTargetModel>(
radiationPressureAcceleration_->getTargetModel( ) ) != nullptr )
{
partialFunction = std::bind( &RadiationPressureAccelerationPartial::wrtRadiationPressureCoefficient,
this, std::placeholders::_1, std::dynamic_pointer_cast<electromagnetism::CannonballRadiationPressureTargetModel>(
radiationPressureAcceleration_->getTargetModel( ) ) );
}
else
{
throw std::runtime_error( "Error in radiation pressure partial for " + acceleratedBody_ + ", requested partial w.r.t. Cr, but no cannonball target found" );
}
parameterSize = 1;
}
return std::make_pair( partialFunction, parameterSize );
}

Expand All @@ -187,13 +203,13 @@ class RadiationPressureAccelerationPartial: public AccelerationPartial
{
std::function< void( Eigen::MatrixXd& ) > partialFunction;
int parameterSize = 0;
if( customAccelerationPartialSet_->customVectorParameterPartials_.count( parameter->getParameterName() )!= 0 )
{
partialFunction = std::bind( &RadiationPressureAccelerationPartial::createCustomParameterPartialFunction, this,
std::placeholders::_1,
customAccelerationPartialSet_->customVectorParameterPartials_.at( parameter->getParameterName() ) );
parameterSize = parameter->getParameterSize( );
}
// if( customAccelerationPartialSet_->customVectorParameterPartials_.count( parameter->getParameterName() )!= 0 )
// {
// partialFunction = std::bind( &RadiationPressureAccelerationPartial::createCustomParameterPartialFunction, this,
// std::placeholders::_1,
// customAccelerationPartialSet_->customVectorParameterPartials_.at( parameter->getParameterName() ) );
// parameterSize = parameter->getParameterSize( );
// }
return std::make_pair( partialFunction, parameterSize );
}

Expand All @@ -207,6 +223,9 @@ class RadiationPressureAccelerationPartial: public AccelerationPartial

protected:

void wrtRadiationPressureCoefficient(
Eigen::MatrixXd& partial, std::shared_ptr< electromagnetism::CannonballRadiationPressureTargetModel > targetModel );

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 @@ -195,7 +195,7 @@ class CovarianceAnalysisInput
}
}

//! Set constant vector weight for all observables of given type and link ends
//! Set constant vector weight for alweightsMatrixDiagonals_l observables of given type and link ends
void setTabulatedSingleObservableAndLinkEndsWeights(
const observation_models::ObservableType currentObservable,
const observation_models::LinkEnds currentLinkEnds,
Expand Down Expand Up @@ -443,6 +443,11 @@ class CovarianceAnalysisInput
return weightsMatrixDiagonals_;
}

void setWeightsMatrixDiagonals( const Eigen::VectorXd& weightsMatrixDiagonals )
{
weightsMatrixDiagonals_ = weightsMatrixDiagonals;
}

//! Function to return the boolean denoting whether the dynamics and variational equations are reintegrated on first iteration
/*!
* Function to return the boolean denoting whether the dynamics and variational equations are to be reintegrated on first
Expand Down
2 changes: 2 additions & 0 deletions include/tudat/simulation/estimation_setup/observations.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ std::vector< std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeT
return splitSingleObervationSet;
}


template< typename ObservationScalarType = double, typename TimeType = double,
typename std::enable_if< is_state_scalar_and_time_type< ObservationScalarType, TimeType >::value, int >::type = 0 >
std::shared_ptr< ObservationCollection< ObservationScalarType, TimeType > > splitObservationSetsIntoArcs(
Expand All @@ -821,6 +822,7 @@ std::shared_ptr< ObservationCollection< ObservationScalarType, TimeType > > spli
return std::make_shared< ObservationCollection< ObservationScalarType, TimeType > >( splitObservationSets );
}


template< typename ObservationScalarType = double, typename TimeType = double,
typename std::enable_if< is_state_scalar_and_time_type< ObservationScalarType, TimeType >::value, int >::type = 0 >
std::vector< std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeType > > > getObservationListWithDependentVariables(
Expand Down
1 change: 0 additions & 1 deletion include/tudat/simulation/estimation_setup/processOdfFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,6 @@ std::shared_ptr< observation_models::SingleObservationSet< ObservationScalarType
}
else
{
std::cout<<"SKIP"<<std::endl;
skipObservation = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ void RadiationPressureAccelerationPartial::update( const double currentTime )
}
}

void RadiationPressureAccelerationPartial::wrtRadiationPressureCoefficient(
Eigen::MatrixXd& partial, std::shared_ptr< electromagnetism::CannonballRadiationPressureTargetModel > targetModel )
{
if( targetModel->getCoefficient( ) == 0.0 )
{
throw std::runtime_error( "Error in full radiation pressure partial w.r.t. Cr, partial is only implemented for non-zero coefficient" );
}
partial = radiationPressureAcceleration_->getAcceleration( ) / targetModel->getCoefficient( );
}

}

}
2 changes: 1 addition & 1 deletion tests/src/astro/observation_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TUDAT_ADD_TEST_CASE(TimeBias PRIVATE_LINKS ${Tudat_ESTIMATION_LIBRARIES})
#
#TUDAT_ADD_TEST_CASE(DsnOdfMro PRIVATE_LINKS ${Tudat_ESTIMATION_LIBRARIES})
#
#TUDAT_ADD_TEST_CASE(DsnOdfGrail PRIVATE_LINKS ${Tudat_ESTIMATION_LIBRARIES})
TUDAT_ADD_TEST_CASE(DsnOdfGrail PRIVATE_LINKS ${Tudat_ESTIMATION_LIBRARIES})

#TUDAT_ADD_TEST_CASE(DsnNWayDopplerObservationModel PRIVATE_LINKS ${Tudat_ESTIMATION_LIBRARIES})

Expand Down
Loading

0 comments on commit 654d500

Please sign in to comment.