Tudat / tudat

NOTE: This Tudat version is no longer supported. See https://docs.tudat.space/en/stable/ and https://github.com/tudat-team/tudat-bundle for the new version
BSD 3-Clause "New" or "Revised" License
87 stars 143 forks source link

Definition of the initialTime inside the integratorSettings in shapeBasedTrajectoryDesign #652

Closed ViktorJordanov closed 1 year ago

ViktorJordanov commented 4 years ago

Hi Marie,

In the part in which perturbations are added, the initialTime of the integratorSettings should be properly defined (with respect to J2000).

Also, in simsFlanaganModel.cpp, in the function convertTimeToLegSegment, rounding would help to make it more robust.

Kind regards, Viktor

SamFayolle commented 4 years ago

Hi Viktor,

Thanks for the reminder!

@DominicDirkx this is just an issue to remind me to fix this properly in Tudat. Yesterday, we already discussed another fix with Viktor for his slightly modified version of Sims-Flanagan.

SamFayolle commented 4 years ago

Changes required to fix this:

In lowThrustLeg.h/cpp, function createLowThrustPropagatorSettings: 1) Add additional input double absoluteDepartureTime 2) Modify the definition of the termination conditions to: _terminationConditions.first = std::makeshared< propagators::PropagationTimeTerminationSettings >( absoluteDepartureTime, true ); _terminationConditions.second = std::makeshared< propagators::PropagationTimeTerminationSettings >( absoluteDepartureTime + timeOfFlight, true );_

Function computeSemiAnalyticalAndFullPropagation: 1) Add additional input double absoluteDepartureTime 2) Modify the definition of the integrator settings for the backward propagation to: integratorSettings->initialTimeStep = - std::fabs( integratorSettings->initialTimeStep ); integratorSettings->initialTime = absoluteDepartureTime + timeOfFlight / 2.0;

3) when storing the results, modify the epochs so that it starts at 0 and ends at TOF (that way it will be consistent with the analytical solution). so: _epochsVector.pushback( itr->first - absoluteDepartureTime ); fullPropagationResults[ itr->first - absoluteDepartureTime ] = itr->second; dependentVariablesHistory[ itr->first - absoluteDepartureTime ] = dependentVariableHistoryBackwardPropagation[ itr->first ];

4) Modify the definition of the integrator settings for the forward propagation to: integratorSettings->initialTimeStep = std::fabs( integratorSettings->initialTimeStep ); integratorSettings->initialTime = absoluteDepartureTime + timeOfFlight / 2.0;

5) Do the same trick as before to store the results of the forward propagation: _epochsVector.pushback( itr->first - absoluteDepartureTime ); fullPropagationResults[ itr->first - absoluteDepartureTime ] = itr->second; dependentVariablesHistory[ itr->first - absoluteDepartureTime ] = dependentVariableHistoryForwardPropagation[ itr->first ];

6) At the end, after the following lines of code: // Reset initial integrator settings. integratorSettings->initialTimeStep = std::fabs( integratorSettings->initialTimeStep ); Add: integratorSettings->initialTime = departureTime;_

In ShapeBasedMethod.h/cpp, function createLowThrustTranslationalStatePropagatorSettings 1) Add additional input double absoluteDepartureTime 2) Modify the definition of the termination conditions to: _terminationConditions.first = std::makeshared< propagators::PropagationTimeTerminationSettings >( absoluteDepartureTime, true ); _terminationConditions.second = std::makeshared< propagators::PropagationTimeTerminationSettings >( absoluteDepartureTime + timeOfFlight, true );_

In SimsFlanagan.h/cpp, function createLowThrustTranslationalStatePropagatorSettings: identical modifications 1) Add additional input double absoluteDepartureTime 2) Modify the definition of the termination conditions: _terminationConditions.first = std::make_shared< propagators::PropagationTimeTerminationSettings >( absoluteDepartureTime, true ); terminationConditions.second = std::makeshared< propagators::PropagationTimeTerminationSettings >( absoluteDepartureTime + timeOfFlight, true );_

DominicDirkx commented 1 year ago

NOTE: This Tudat version is no longer supported. See https://docs.tudat.space/en/stable/ and https://github.com/tudat-team/tudat-bundle for the new version