Closed ViktorJordanov closed 1 year 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.
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 );_
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
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