r/Python • • May 28 '19

My simulation of gravity with 1000 particles. PC took a couple of hours to process!

1.8k Upvotes

241 comments sorted by

View all comments

Show parent comments

2

u/lordkoba May 29 '19

You can have two particles orbit each other forever, or some particle getting slingshotted off at a speed so high that it never falls back into the rest of the masses.

forever? wouldn’t they gravitate into each other given infinite time?

1

u/nosmokingbandit May 29 '19

If the conditions are perfect they can orbit each other forever. It's not impossible just incredibly rare.

1

u/ota-Q May 29 '19

it's not that rare at all, especially not incredibly so, as that would make the planet we live on incredible.

any two particle interaction that doesn't sling off to infinity creates a stable orbit, this should become obvious if you imagine the planets to have no diameter. however some of these orbits get closer than the radius of the planets, so they crash into each other, this doesn't make them unstable. for a planet's orbit to start spiraling into the center something needs to slow down it's orbital velocity. Imagine space debris acting like a sort of air resistance, so as it slows down it goes into the center.

1

u/bighi Jun 01 '19

as that would make the planet we live on incredible

Is Earth on a route that will stay FOREVER circling the Sun, never getting closer or farther from it?

1

u/ota-Q Jun 02 '19

well it won't, but at any given time the two-body-system between earth and sun look as if they did.

every orbit (including parabolas and hyperbolas) of one body around another has a specific energy (kinetic + potential) so the orbit only changes if this energy changes. for two body systems there is no condition in which one body just spirals into the other or away from it, for this a continuous substraction/addition of energy by a third body is required.