Well, my algorithm seems to work for the subgroup of trojans at L4 / L5 of planets NOT in a binary system.
What do I do? (Go to ALGORITHM HERE to skip the boring details)
As usual, I work with the EDSM bodies.json-file which can be downloaded here.
I am NOT working with a database. It is on my list to learn that, though. That however may make it a bit easier for others to run the code I wrote (once I've cleaned, commented and published it) since it does not require knowledge of how to setup a database.
With >80 GB is the database far too large to work on it. So first I extract just the orbital parameters (and name and system name) for each body and save it after every 5000000 entries in a new file.
This takes quite a while on my 2012 laptop.
The problem now is, that the bodies that belong to one system can be scattered over several files because it is not sorted in the EDSM file.
Hence, I then compare the information of each file with each other file and take care of that every file contains complete system information. One could call this "defragmentation" of the data.
This takes also quite a while. Several hours in fact.
I'm pretty sure these two steps are NOT necessary if one works with a database.
So now I have a file which is separated into systems and each system contains the orbital parameters of each (reported) body of this system. Neat
< ALGORITHM HERE >
Then I check for each body in every system its name and compare it with the names of all other bodies.
In principle a trojan can't be a moon and must be on the same level.
So < FOO BAR AB 1 > can be a trojan to < FOO BAR AB 2 > but neither to < FOO BAR AB 1 a > nor to < FOO BAR CDE 2 >.
This is a remnant from when I tried to find trojans to binary systems.
For the reduced version of this algorithm I would just need to check if the "root" of the name is the same and the "counter" at the end one higher (or lower).
However, this gives me then all the trojan candidates in a system.
For these candidates I check then if orbital period, orbital eccentricity and orbital inclination are the same.
THIS will give me millions of binary system and a couple of thousand trojans.
Now I've made the curious observation that the difference of the argument of periapsis of the two planets in a binary system is exactly 180 degrees.
ATTENTION: THIS OBSERVATION MAY BE WRONG!
So, I simply exclude all of the candidates that have this difference in the value of their argument of periapsis.
Unfortunately will this also exclude all trojans at L3 (if they exist in the game).
Well, what I actually do is a bit different. I INCLUDE just candidates that have a difference in the value of their argument of periapsis of 60 degrees. But it was easier to explain the issue with the binaries the other way around.
Finally I look up the coordinates of the systems in which these trojans are but that is just of practical concern.
And that seems to work.
In the EDSM data from 3305-06-04 I found 4403 trojans (fromthe above mentioned subgroup) this way. Three of these I've confirmed.
If anybdoy wants to check some more, please tell me where you are and I will send you the three / five / twentythree / as many as you want closest to you.
@Orvidius: Do you want to make a list out of that? I could send you a CSV.
What do I do? (Go to ALGORITHM HERE to skip the boring details)
As usual, I work with the EDSM bodies.json-file which can be downloaded here.
I am NOT working with a database. It is on my list to learn that, though. That however may make it a bit easier for others to run the code I wrote (once I've cleaned, commented and published it) since it does not require knowledge of how to setup a database.
With >80 GB is the database far too large to work on it. So first I extract just the orbital parameters (and name and system name) for each body and save it after every 5000000 entries in a new file.
This takes quite a while on my 2012 laptop.
The problem now is, that the bodies that belong to one system can be scattered over several files because it is not sorted in the EDSM file.
Hence, I then compare the information of each file with each other file and take care of that every file contains complete system information. One could call this "defragmentation" of the data.
This takes also quite a while. Several hours in fact.
I'm pretty sure these two steps are NOT necessary if one works with a database.
So now I have a file which is separated into systems and each system contains the orbital parameters of each (reported) body of this system. Neat
< ALGORITHM HERE >
Then I check for each body in every system its name and compare it with the names of all other bodies.
In principle a trojan can't be a moon and must be on the same level.
So < FOO BAR AB 1 > can be a trojan to < FOO BAR AB 2 > but neither to < FOO BAR AB 1 a > nor to < FOO BAR CDE 2 >.
This is a remnant from when I tried to find trojans to binary systems.
For the reduced version of this algorithm I would just need to check if the "root" of the name is the same and the "counter" at the end one higher (or lower).
However, this gives me then all the trojan candidates in a system.
For these candidates I check then if orbital period, orbital eccentricity and orbital inclination are the same.
THIS will give me millions of binary system and a couple of thousand trojans.
Now I've made the curious observation that the difference of the argument of periapsis of the two planets in a binary system is exactly 180 degrees.
ATTENTION: THIS OBSERVATION MAY BE WRONG!
So, I simply exclude all of the candidates that have this difference in the value of their argument of periapsis.
Unfortunately will this also exclude all trojans at L3 (if they exist in the game).
Well, what I actually do is a bit different. I INCLUDE just candidates that have a difference in the value of their argument of periapsis of 60 degrees. But it was easier to explain the issue with the binaries the other way around.
Finally I look up the coordinates of the systems in which these trojans are but that is just of practical concern.
And that seems to work.
In the EDSM data from 3305-06-04 I found 4403 trojans (fromthe above mentioned subgroup) this way. Three of these I've confirmed.
If anybdoy wants to check some more, please tell me where you are and I will send you the three / five / twentythree / as many as you want closest to you.
@Orvidius: Do you want to make a list out of that? I could send you a CSV.