It'd be great if there was a function that, given an orbit, would tell if, when and where it intersected with the body being orbited.
I'd like to use this to create a plot of the orbits of many objects with slightly different starting conditions.
@void4 hi, thanks for your interest in poliastro!
There you have it :) https://docs.poliastro.space/en/stable/api/safe/twobody/events.html#poliastro.twobody.events.LithobrakeEvent
Here is how to use it:
Can you confirm if this suits your needs?
Yes, I think that might be it. I tried to reduce the acceptable error in the propagate() function but that seemed to make it too inaccurate, using methods other than cowell didn't seem to return a valid Lithobrake value. Even without an atmosphere the propagate() function seemed to take about 10 seconds per orbit.
So it might not be fast enough for my purposes, plotting (properties of) thousands of orbits, but I suppose weird art wasn't exactly on of the envisioned use cases ^^
I created the below with a naive 3d newtonian gravity simulation. There is a binary system of heavy masses with their center of mass at the center of the image. I colored each (x,y) coordinate blue or green if a light mass put at that location would collide - within some number of simulation steps - with one of the masses:

I'm not sure what the terminology for this is, currently asking here: https://physics.stackexchange.com/questions/571480/name-and-properties-of-orbit-collision-map
So maybe I should try to optimize my own solver instead (https://gist.github.com/void4/a6dc3e9d6e0ad9b0fa6223a9592d132e)
One day I'd also like to 3d-plot something like this: https://www.youtube.com/watch?v=n2eBwgW6sig
P.S. This library is one of these "holy shit"-level ones of awesomeness where one realizes one can do crazy things with just a few lines of imports and code. Big kudos on this one!
P.S. This library is one of these "holy shit"-level ones of awesomeness where one realizes one can do crazy things with just a few lines of imports and code. Big kudos on this one!
:heart_eyes: Best compliment ever!!
using methods other than cowell didn't seem to return a valid Lithobrake value.
Depending on how are you modelling your system, cowell might be the only option - although in principle poliastro is meant for the two body problem (with some specialized functions for the circular restricted three body problem)
Even without an atmosphere the propagate() function seemed to take about 10 seconds per orbit.
That's really weird, would you like to share a small part of that code so I can try to reproduce? 10 seconds per orbit is a bit too much, unless you're propagating a really long time. And even if that's the case, perhaps we can look for ways to parallelize the code.
I'm not sure what the terminology for this is, currently asking here
I don't have the answer, but upvoted already :)
So maybe I should try to optimize my own solver instead
It looks similar to what cowell does. I doubt you can make it faster but I wouldn't mind being proven wrong :wink:
10 seconds per orbit is a bit too much
Oh, I see, I used a huge TimeDelta (the 100 days from the example). I'm also running on an already hot laptop ^^
But then again, for the longer periods I need and because
in principle poliastro is meant for the two body problem
and
It looks similar to what cowell does
I will continue to use my own solver.
Nonetheless, it was great to come into contact with this library and you. Have a great day!
@astrojuanlu Just in case this stuff is of interest to you, someone pointed me to this paper, where these apparently called "orbit type diagrams" are more closely described: https://pdfs.semanticscholar.org/2d2f/ea1fcccf769193b0a6c75adbac54d9aec76c.pdf
What this paper seems to confirm is that when inserting a light third mass into a two-body system, there are regions in space where the ultimate fate of that mass - crash, escape or bounded motion - depends on its infinitely precise location. Displace the mass only slightly in this region and its behavior could be drastically different, like with the initial configuration of a double pendulum
So even in some parts of the Earth-Moon system it might not be possible to calculate the (passive) trajectory of an spaceship reliably, even with very accurate sensors and lots of computing power!
This is fascinating! (DOI 10.1103/PhysRevE.71.026227 for future reference). Thanks for the reference!
I just remembered this open source N-body integrator that you might find useful https://github.com/hannorein/rebound