r^-5 "Orbital Decay"?

What did you draw?
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

r^-5 "Orbital Decay"?

Postby A Random Player » Mon Jun 03, 2013 8:44 pm

So, I've been noticing something. Load this code:

Code: Select all

Gravity Fun at TestTubeGames.com: [ForceG: -5,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: -138,y0: 71,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: -100,y0: 71,vx: 0,vy: -21.899429779559423,t0: 0,who: 3,m: 0], [x0: -72,y0: 71,vx: 0,vy: -7.259590588081679,t0: 0,who: 3,m: 0], [x0: -49,y0: 72,vx: 0.04484848147995428,vy: -3.991514851715931,t0: 0,who: 3,m: 0]

And watch. The asteroids slowly escape the star, and the closer to the star, the faster they leave. This effect also happens with other gravitational pulls (to around -3), and with planets instead of asteroids. They also may decay inwards, as well.

Is this just an artifact of the limited precision, or does this really happen (sort of like "inverse precession")? I'm pretty sure it's the former, though I don't understand why it doesn't happen at exponents closer to r^-2. (Or maybe it just takes quite a long time? No, this doesn't "decay":

Code: Select all

Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 5,y0: 41,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 9,y0: 39,vx: -6.69,vy: -13.37,t0: 0,who: 3,m: 0]

)
$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: 1007
Joined: Mon Nov 19, 2012 7:54 pm

Re: r^-5 "Orbital Decay"?

Postby testtubegames » Tue Jun 04, 2013 10:59 am

Oh, that's great! You've discovered an interesting fact about these force laws.

It was only recently I added in the option to go as low as r^-5 force (before the minimum was r^-3). When I made the change, I noticed the same behavior. In fact, at the time, it was even worse... I couldn't get an asteroid to make a single complete loop around a star without crashing into it or flying off. The reason for this is indeed limited precision and compounding errors. So I increased the precision a bit, and it helped a bit. In the first code you posted, you'll notice the velocities have a bunch of extra digits. It keeps things in orbit a little while longer.

There is, though, some neat physics that you've found. It turns out that in every (attractive) central-force law, you can have a circular orbit. That doesn't mean the orbits are stable. With some exponents, like r^-2, a circular orbit is stable. That means even if the asteroid is a little bit off from a true circular orbit, it will never deviate much -- just like a marble sitting at the bottom of a bowl. That's why we can get away the low-precision velocities in the second code you posted. As long as the velocities are 'close enough', the orbit will be fine.

For other exponents, like r^-5, circular orbits are unstable. If the asteroid is a little bit off from the true circular orbit, the errors compound quickly. Like a marble sitting on top of a hill, any tiny deviation can send it rolling away.

It turns out the dividing line between stable and unstable orbits is exactly what you've discovered. For exponents less than (or equal to) -3, the orbits are unstable. For exponents greater than -3, the orbits are stable. You discovered this experimentally (nice!). You can calculate it theoretically (aka math-y), too, and here's a link to that: (http://farside.ph.utexas.edu/teaching/3 ... ode45.html)

---

By the by, that second one surprised me. I don't think I've ever tried such a close circular orbit before -- inside the star! ... I'm glad to see it worked. I'm also glad I'm not on that planet!

A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: r^-5 "Orbital Decay"?

Postby A Random Player » Tue Jun 04, 2013 4:59 pm

That's interesting! I'd have never though of that.
..I did some sciencing, and found that the orbital velocity of a r^-2 is approximately v=31.419*d^(-1/2), with this code and some excel:

Code: Select all

Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 96,ySet: 2], [x0: -103,y0: 21,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: -35,y0: 22,vx: 0.06,vy: -3.83,t0: 0,who: 3,m: 0], [x0: 25,y0: 22,vx: 0.02,vy: -2.79,t0: 0,who: 3,m: 0], [x0: 87,y0: 24,vx: 0.04,vy: -2.29,t0: 0,who: 3,m: 0], [x0: 144,y0: 27,vx: 0.05,vy: -2.01,t0: 0,who: 3,m: 0], [x0: 206,y0: 28,vx: 0.04,vy: -1.8,t0: 0,who: 3,m: 0]

With that formula, I've been able to make codes like this one:

Code: Select all

Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 2,y0: 0,vx: 0,vy: 22.2165879581001,t0: 0,who: 3,m: 0]

Anything closer to the sun collides (?) too quickly.


Though 31.419 seems quite close to 10pi or sqrt(1000), is this a coincidence?
$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: 1007
Joined: Mon Nov 19, 2012 7:54 pm

Re: r^-5 "Orbital Decay"?

Postby testtubegames » Wed Jun 05, 2013 10:28 am

That's no coincidence (well, the PI thing is) -- the actual equation for a circular orbit is:

speed = sqrt(G*M/d)

(Assuming the asteroid has negligible mass, which it does.) For the basic inverse-square law, the G (gravitational constant) in the simulation is 1. The Mass of your star is 1000. So the speed ends up being sqrt(1000/d). Experimentally, you came very close (especially given the very few sig-figs you had to work with!) The coefficient is 31.6227766017.

I suppose the more exact velocity might help you get a smidge closer, but you'll still be running into problems. For starters, in that situation, an asteroid is destroyed when it is closer to the star than .5 units. Even further out than that, though, you'll still have trouble keeping a circular orbit. The speed of the asteroid needs to be so fast that eventually the refresh-rate of the simulator gets to be too coarse for it. You can bump the simulation up to 'high quality,' by clicking the menu button (you're currently in 'medium quality'). That just increases the refresh-rate of the simulation... not ideal if you've got tons of objects moving around... but good for this situation.

Even then, I can get an asteroid to orbit at a distance of 1 for just 30 seconds or so...

Code: Select all

Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 2,Zoom: 1,xSet: 15,ySet: -47], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 1,y0: 0,vx: 0,vy: 31.6227766017,t0: 0,who: 3,m: 0]

19683
Posts: 151
Joined: Wed Jun 05, 2013 12:15 pm

Re: r^-5 "Orbital Decay"?

Postby 19683 » Wed Jun 05, 2013 12:23 pm

I noticed something else too. r^-2 creates stable eliptical orbits, but r^-1 creates eliptical orbits which precess, creating "doughnut holes". To see this, use the following code: Gravity Fun at TestTubeGames.com: [ForceG: -1,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 11,y0: -16,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 118,y0: -11,vx: 0,vy: -2.15,t0: 401.4,who: 3,m: 0]

Running this for a few minutes makes a cool (and stable) pattern. Have fun.
Last edited by 19683 on Thu Jun 06, 2013 9:40 am, edited 1 time in total.
Binomial Theorem: ((a+b)^n)= sum k=0->k=n((n!(a^(n-k))(b^k))/(k!(n-k)!))

User avatar
testtubegames
Site Admin
Posts: 1007
Joined: Mon Nov 19, 2012 7:54 pm

Re: r^-5 "Orbital Decay"?

Postby testtubegames » Wed Jun 05, 2013 1:10 pm

Yeah, it reminds me of those old spirographs. The planet can only get so close to the star, and only so far, and then inside that range it just spirals around.

It turns out r^-2 is pretty special for getting closed elliptical orbits. (Thank goodness for the fact Newtonian gravity *is* r^-2... just imagine how much harder physics classes would be otherwise!)

User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: r^-5 "Orbital Decay"?

Postby robly18 » Wed Jun 05, 2013 2:03 pm

testtubegames wrote:Yeah, it reminds me of those old spirographs. The planet can only get so close to the star, and only so far, and then inside that range it just spirals around.

It turns out r^-2 is pretty special for getting closed elliptical orbits. (Thank goodness for the fact Newtonian gravity *is* r^-2... just imagine how much harder physics classes would be otherwise!)

I can't help but feel having a universe where it was r^1 would be interesting... On the other hand, we'd be pulled to a dust particle a thousand light years away with more force than to our own earth. Oh well.
Convincing people that 0.9999... = 1 since 2012

A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: r^-5 "Orbital Decay"?

Postby A Random Player » Wed Jun 05, 2013 4:38 pm

It would actually be like springs are connecting every atom (and subatomic particle?!) ;)
$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: 1007
Joined: Mon Nov 19, 2012 7:54 pm

Re: r^-5 "Orbital Decay"?

Postby testtubegames » Wed Jun 05, 2013 4:44 pm

That certainly would make space travel a lot easier. And compulsory.

You could visit all the galaxies. At once. In some roiling ball of incredibly hot matter condensed at the heart of the universe.

A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: r^-5 "Orbital Decay"?

Postby A Random Player » Wed Jun 05, 2013 4:50 pm

testtubegames wrote:That certainly would make space travel a lot easier. And compulsory.

You could visit all the galaxies. At once. In some roiling ball of incredibly hot matter condensed at the heart of the universe.

Not necessarily.. The universe is isotropic (I think) and infinite, so one will be pulled from all sides the same.. But how would the universe know which "side" of the infinity has more mass?
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!


Return to “Gravity Simulator”

Who is online

Users browsing this forum: No registered users and 1 guest