N Body Orbits

What did you draw?
Post Reply
DavidAllyn68
Posts: 28
Joined: Thu Aug 01, 2013 2:28 pm

N Body Orbits

Post by DavidAllyn68 »

Ok, so I stumbled upon this... http://users.soe.ucsc.edu/~charlie/3body/

How do we apply it to the gravity simulator? I've made many failed attempts, and I suspect it will take the talents of ARP and his Python magic! (I especially love the "8 on a daisy" orbit). There are some pretty cool orbits dat be need'n sum 'rplecation son...
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: N Body Orbits

Post by A Random Player »

DavidAllyn68 wrote:Ok, so I stumbled upon this... http://users.soe.ucsc.edu/~charlie/3body/

How do we apply it to the gravity simulator? I've made many failed attempts, and I suspect it will take the talents of ARP and his Python magic! (I especially love the "8 on a daisy" orbit). There are some pretty cool orbits dat be need'n sum 'rplecation son...
Woah. Those are cool. I don't think you'd need python though. Just take the initial values and change their formatting. (Finding the initial values is the hard part, some of the links there might have it though.) Instability might kill it though.
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: N Body Orbits

Post by testtubegames »

Wow, those are amazing. The daisy (among others) blew my mind. These would take some precision crafting -- and unfortunately one of the resources he mentioned isn't working for me (the ucsc site is broken). I'm sure the data is around somewhere, and if anyone could translate it into the gravity sim, I know it's you all!

I agree with Random that most of these are highly unstable. But if we could get something like these to run for even a few cycles that would be really neat. (I'm happy to make some changes on my end -- perhaps adding an even higher quality setting to the game, if it comes to that)
DavidAllyn68
Posts: 28
Joined: Thu Aug 01, 2013 2:28 pm

Re: N Body Orbits

Post by DavidAllyn68 »

Ok, I went and got crazy and created a .NET application that renders gravity code for N-Body systems. I have an OrbitingBodies collection of an OrbitingBody class. This allows me to quickly generate systems. Right now, I only have a method that creates a circle (i.e. equal radian/degree separation between bodies) configuration.

What I'm finding is that a two-body mutual orbit is always fairly stable. Any more bodies than 2, however, after a couple of orbital cycles, with any change in velocity (which ends up happening "organically", it seems) compounds the neighboring body's gravity effect and quickly creates clumps of bodies. Pretty cool stuff.

I've also found that a system that has a strong "foundational" mass (i.e. a big star) in the center with respect to the "outer" mass (i.e. the planet masses combined), the more stable the orbit can be.

Here's a 5 star orbit with a big sun:

Code: Select all

Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: .5,xSet: 0,ySet: 0],[x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: 20000], [x0: 200,y0: 0,vx: 0,vy: -10,t0: 0,who: 2,m: 10], [x0: 61.80339887,y0: 190.21130326,vx: 9.51056516,vy: -3.09016994,t0: 0,who: 2,m: 10], [x0: -161.80339887,y0: 117.55705046,vx: 5.87785252,vy: 8.09016994,t0: 0,who: 2,m: 10], [x0: -161.80339887,y0: -117.55705046,vx: -5.87785252,vy: 8.09016994,t0: 0,who: 2,m: 10], [x0: 61.80339887,y0: -190.21130326,vx: -9.51056516,vy: -3.09016994,t0: 0,who: 2,m: 10] 
Here's the same bodies without a sun. The velocities are reduced to keep a circular orbit.:

Code: Select all

Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0],[x0: 200,y0: 0,vx: 0,vy: -0.262,t0: 0,who: 2,m: 10], [x0: 61.80339887,y0: 190.21130326,vx: 0.24917681,vy: -0.08096245,t0: 0,who: 2,m: 10], [x0: -161.80339887,y0: 117.55705046,vx: 0.15399974,vy: 0.21196245,t0: 0,who: 2,m: 10], [x0: -161.80339887,y0: -117.55705046,vx: -0.15399974,vy: 0.21196245,t0: 0,who: 2,m: 10], [x0: 61.80339887,y0: -190.21130326,vx: -0.24917681,vy: -0.08096245,t0: 0,who: 2,m: 10] 
As you can see, it only takes a few full orbits without a sun for the system to destabilize, and for the bodies to begin to clump together. It just seem necessary that you have a central, foundational mass to keep things together. Even if you have a sun in the center where the mass differential between that of the sun and those of the planets is not large enough, the planets begin to have more influence on each other than the sun has on them. That "foundation" is lost, and the planets act as if there was no sun at all. Of course, we are talking about bodies sharing an orbit....

What I find truly awesome is our solar system has been "stable" for BILLIONS of cycles. How would there be any logical theory other than an accretion disc? The system must have to "grow" into it's final configuration to be "truly" stable. No?

For fun, here's a 20 body system :mrgreen: :

Code: Select all

Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: .5,xSet: 0,ySet: 0],[x0: 150,y0: 0,vx: 0,vy: -0.814,t0: 0,who: 2,m: 10], [x0: 142.65847744,y0: 46.35254916,vx: 0.25153983,vy: -0.77416,t0: 0,who: 2,m: 10], [x0: 121.35254916,y0: 88.16778784,vx: 0.4784572,vy: -0.65853983,t0: 0,who: 2,m: 10], [x0: 88.16778784,y0: 121.35254916,vx: 0.65853983,vy: -0.4784572,t0: 0,who: 2,m: 10], [x0: 46.35254916,y0: 142.65847744,vx: 0.77416,vy: -0.25153983,t0: 0,who: 2,m: 10], [x0: 0,y0: 150,vx: 0.814,vy: 0,t0: 0,who: 2,m: 10], [x0: -46.35254916,y0: 142.65847744,vx: 0.77416,vy: 0.25153983,t0: 0,who: 2,m: 10], [x0: -88.16778784,y0: 121.35254916,vx: 0.65853983,vy: 0.4784572,t0: 0,who: 2,m: 10], [x0: -121.35254916,y0: 88.16778784,vx: 0.4784572,vy: 0.65853983,t0: 0,who: 2,m: 10], [x0: -142.65847744,y0: 46.35254916,vx: 0.25153983,vy: 0.77416,t0: 0,who: 2,m: 10], [x0: -150,y0: 0,vx: 0,vy: 0.814,t0: 0,who: 2,m: 10], [x0: -142.65847744,y0: -46.35254916,vx: -0.25153983,vy: 0.77416,t0: 0,who: 2,m: 10], [x0: -121.35254916,y0: -88.16778784,vx: -0.4784572,vy: 0.65853983,t0: 0,who: 2,m: 10], [x0: -88.16778784,y0: -121.35254916,vx: -0.65853983,vy: 0.4784572,t0: 0,who: 2,m: 10], [x0: -46.35254916,y0: -142.65847744,vx: -0.77416,vy: 0.25153983,t0: 0,who: 2,m: 10], [x0: 0,y0: -150,vx: -0.814,vy: 0,t0: 0,who: 2,m: 10], [x0: 46.35254916,y0: -142.65847744,vx: -0.77416,vy: -0.25153983,t0: 0,who: 2,m: 10], [x0: 88.16778784,y0: -121.35254916,vx: -0.65853983,vy: -0.4784572,t0: 0,who: 2,m: 10], [x0: 121.35254916,y0: -88.16778784,vx: -0.4784572,vy: -0.65853983,t0: 0,who: 2,m: 10], [x0: 142.65847744,y0: -46.35254916,vx: -0.25153983,vy: -0.77416,t0: 0,who: 2,m: 10], 
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: N Body Orbits

Post by robly18 »

DavidAllyn68 wrote: What I find truly awesome is our solar system has been "stable" for BILLIONS of cycles. How would there be any logical theory other than an accretion disc? The system must have to "grow" into it's final configuration to be "truly" stable. No?
Like you said, the system gets more stable the bigger the Sun-Planets ratio is. Now, take into account how big our sun is compared to Earth...
Also, distance probably affects it...
Convincing people that 0.9999... = 1 since 2012
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: N Body Orbits

Post by testtubegames »

That's interesting to use the sun to anchor the co-orbiting bodies. I suppose it makes sense that it helps, since at that point, the planets basically have negligible mass when compared to that sun. So really, it's almost as if those are 5 asteroids instead of planets.
DavidAllyn68
Posts: 28
Joined: Thu Aug 01, 2013 2:28 pm

Re: N Body Orbits

Post by DavidAllyn68 »

I've tried many, many times to make a N-Body orbit work (using Gravity Games as the engine), but they almost always become unstable after about 5 or 6 "cycles". It could be that there are inaccuracies that are introduced from rounding somewhere causing one body to have a slightly higher velocity, but even in "real life" that would happen naturally.

Suppose there is a "real" 5 body co-orbit happening somewhere with no central, foundational mass -- except their own. There will always be things that will help or hinder velocities -- even if it's miniscule -- eventually three of the planets will gravitate more toward each other than the two left over. Then, very rapidly, the system breaks down and splits apart.

What I find really interesting about it is how the model mirrors real life. Every orbiting system is orbiting something -- if nothing other than the super massive black hole at the center of the galaxy.
Post Reply