hannorein / rebound

💫 An open-source multi-purpose N-body code.
https://rebound.readthedocs.io/
GNU General Public License v3.0
866 stars 221 forks source link

MOID calculation at a given timestep #776

Open tamidodo opened 5 months ago

tamidodo commented 5 months ago

There are C++ libraries (https://sourceforge.net/projects/distlink/) to calculate the MOID between two orbits but it would be really useful to integrate something like that into the REBOUND package so a user can collect that value the same way you can get orbital elements with respect to a primary body at a given timestep.

hannorein commented 5 months ago

Hi Tammy,

That would be a nice feature. I don't have any experience with this myself. Do you know if this implementation is any good? The code looks relatively clean, relatively short, and could probably be easily ported over to C. It doesn't include any license, so one should probably get in touch with the author beforehand and ask if it's ok to include.

Hanno

tamidodo commented 5 months ago

A recent paper used rebound to integrate a large number of fireballs and JFCs, somehow integrating this code into their runs such that they could get the MOID at every timestep they collected the orbital elements and positional information so it has been done, they just don't describe in any detail how exactly they did that and their code isn't public... I was considering reaching out to these folks to ask how they did it but I figured this would also just be a useful addition to the rebound package in general. Should I reach out to the authors then?

https://arxiv.org/pdf/2405.08224 https://www.sciencedirect.com/science/article/abs/pii/S2213133718301173

hannorein commented 5 months ago

I think the C++ code that you posted a link to is enough! I'd probably rather e-mail the authors of that...

I don't quite understand the point of calculating MOID every timestep? Isn't the idea that you input two keplerian orbits and get an answer that, ignoring planet interactions, is constant?

tamidodo commented 5 months ago

The point is that over time, the orbital elements of one of the objects is changing, due to interactions with planets and radiative forces. I'm interested in finding the MOID between Jupiter and the meteoroid over time, as it is relevant to classifying the orbit of the meteoroid.

Would you like me to email the authors of the C++ code and cc you on it?

hannorein commented 5 months ago

That would be great! Ask them if it's ok if we include their algorithm into REBOUND, with the proper attribution of course.

hannorein commented 5 months ago

@tamidodo Thanks for asking for permission.

I'm not sure if you want to have a go at it or not. If so feel free to go ahead! I can work on it myself but I will probably not get to it until at least a couple of weeks.

In either case, here's a checklist:

hannorein commented 3 weeks ago

I have not forgotten about this! I looked into it a bit. But their algorithm offers a several different options with different solvers, ways to check the convergence. I am feeling a bit overwhelmed by this because I'm just not very familiar with the possible use cases. If you @tamidodo (or someone) else has use this MOID algorithm and can provide a bit of guidance, that would be most appreciated.