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

SGP4 propagator #103

Closed mhaneveer closed 5 years ago

mhaneveer commented 7 years ago

Has the SGP4 been added to the list of propagators? I thought to have heard about the addition during last meeting, but I can't seem to find it.

This issue might be possible to be merged with issue #52, regarding the TLE to Kepler Elements conversion and its verification with the SGP4 initial state output.

DominicDirkx commented 7 years ago

SGP4 propagation is not currently supported by Tudat, the issue you are referring to is only on the reading of TLE files, which is included. However, the issue you mention may indicate that there is an issue with it.

There is C/C++ code available for SGP4 propagation, and linking it to Tudat would be a great feature. Jacco has had extensive experience with SGP4, I think he is the best person to approach about using the propagation with/in Tudat.

magnific0 commented 7 years ago

I'm on it. Glad to hear other people want to delve into SGP too!

Recap from private meeting: there are two options (1) I have a personal adaptation of C++ SGP4 code by Vallado Tudat ready. (2) @mhaneveer pointed my to Daniel Warner's (danrw.com) C++ SGP4 code which is GCC and CMake compatible. I have just sent him an e-mail about hosting his project on GitHub.

There are some benefits / downsides to either option. Both codes are functionally slightly different (1) has a differential correction routine for estimating TLEs from observations (range, camera, inertial, TLEs) while (2) has some pass / tracking programs. (1) is more renowned and the source for all SGP4 codes (2) just seems better written.

We should probably make a decision soon on which direction to take, because either code would be very useful to have.

mhaneveer commented 7 years ago

@magnific0 I've compared DanRW's C++ SGP4 code with the Matlab SGP4 code from Valledo, see below for the results.

Dan's code has WGS72 hard-coded in it, while Valledo's Matlab code can also be used with the newer WGS84. Do you if WGS84 is also used in Valledo's C++ code?

difference_danrw_matlab wgs72 _sgp4

Just out of curiosity I compared Dan's C++ (WGS72) with Valledo's Matlab (WGS84), which resulted in the plot below. As expected, the difference is definitely notable, and with a magnitude varying between meters to tens of meters as opposed to the sub-meter variation with the WGS72-WGS72 comparison.

difference_danrw_matlab wgs84 _sgp4

DominicDirkx commented 7 years ago

Although there is a definite difference between the WGS72/WGS84 results, the internal consistency is still much better than the actual orbital accuracy of TLEs. However, for comparison studies I understand that being able to compare results well below their physical accuracy would be advantageous.

Since Vallado's code is essentially the standard for SGP4 propagation, my preference would go towards the inclusion of this package as a library, especially since @magnific0 already has a Tudat-compatible version available.

That being said, if the the danrw.com is really much more clearly written, this may be a good argument for it from a transparency point of view. Do you foresee that people will have to modify this code themselves in the future?

magnific0 commented 7 years ago

@mhaneveer thanks a lot for making the comparison. It is really interesting. WGS84 (like for Matlab) is optional in the C++ code. It is indeed negligible compared to TLE accuracy, but I am curious how the C++ and Matlab code from Vallado compare, to determine whether these differences are due to implementation or language.

@DominicDirkx I agree, I don't foresee a need for students or anyone touching the code. I think we should strive to keep SGP4 as unmodified as possible. For my adaptation I have only limited myself to fixing compilation issues, resisting urges to fix coding and style issues.

I have reapplied all my fixes to the code from the website from Vallado and committed them separately, such that it is really clear how "our" SGP4 differs from the original. You can find the repository at: https://github.com/magnific0/SGP4

Any comments are welcome. Next I'll create a branch of the tudatBundle with the FindSGP4.cmake.

Left todo:

magnific0 commented 7 years ago

52 which spiked interest in adding a proper SGP4 propagator to Tudat was just closed. After a proper solution, as discussed in this issue, is implemented the TLE file reader of Tudat should be deprecated.

DominicDirkx commented 7 years ago

Just curious if there is any activity on this issue. If not, let's limit it to doing something about the (wrong?) TLE reader in Tudat.

wjhuisman commented 5 years ago

Hi,

I am interested in using the TLE reader and the SGP4 propagator for my thesis (propagation of LEO objects), and I was wondering what the status of this is at the moment, seeing that this discussion took place almost two years ago. I can find the corresponding TLE to text header files in the bundle, but I am having trouble trying to figure out how the different functionalities are connected with each other. Is there an example somewhere that shows the use of the TLE reader and SGP4 in tudat?

DominicDirkx commented 5 years ago

Tracked in #437