Challenge: Lagrange Points
-
- Posts: 151
- Joined: Wed Jun 05, 2013 12:15 pm
Challenge: Lagrange Points
Try to put an asteroid at each Lagrange point of a star-planet system. Try to make them as stable as possible.
Binomial Theorem: ((a+b)^n)= sum k=0->k=n((n!(a^(n-k))(b^k))/(k!(n-k)!))
-
- Posts: 1
- Joined: Mon Jul 15, 2013 11:10 pm
Re: Challenge: Lagrange Points
I think I have done it. It might be a little off
Code: Select all
Gravity Fun at TestTubeGames.com: [ForceG: 1,Qual: 1,Zoom: 1,xSet: 35,ySet: 23], [x0: -55,y0: -47,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: -28,y0: 25,vx: 2.28,vy: -0.85,t0: 227.7,who: 2,m: 100], [x0: 1,y0: -46,vx: 0.03,vy: -1.77,t0: 464.4,who: 3,m: 0]
-
- Posts: 13
- Joined: Wed Jun 12, 2013 6:29 am
Re: Challenge: Lagrange Points
Code: Select all
Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 3,y0: -13,vx: 0,vy: 0,t0: 0,who: 1,m: 1626], [x0: -150,y0: -13,vx: 0,vy: 3.26,t0: 0,who: 2,m: 42], [x0: -70,y0: 121,vx: 2.87,vy: 1.56,t0: 296.1,who: 3,m: 0], [x0: -77,y0: -140,vx: -2.78,vy: 1.75,t0: 296.1,who: 3,m: 0]
-
- Posts: 523
- Joined: Mon Jun 03, 2013 4:54 pm
Re: Challenge: Lagrange Points
That's in r^1 gravityNicbudd wrote:I think I have done it. It might be a little offCode: Select all
Gravity Fun at TestTubeGames.com: [ForceG: 1,Qual: 1,Zoom: 1,xSet: 35,ySet: 23], [x0: -55,y0: -47,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: -28,y0: 25,vx: 2.28,vy: -0.85,t0: 227.7,who: 2,m: 100], [x0: 1,y0: -46,vx: 0.03,vy: -1.77,t0: 464.4,who: 3,m: 0]

---
So, I've tried this several times, but I never got it to work. My most recent attempt went like this:
Begin by using a simple orbit:
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: 100,y0: 0,vx: 0,vy: -3.1622776601683795,t0: 0,who: 2,m: 100]
2pi*r/sqrt(r*(1000/r^2+100/(r-100)^2))=2pi*sqrt(100^3/1000)
Explanation: 1000/r^2+100/(r-100)^2 is the force/acceleration toward the center of the system. By a=v^2/r, sqrt(r*(1000/r^2+100/(r-100)^2)) is the orbital velocity, and with C=2pi*r and d=vt, 2pi*r/sqrt(r*(1000/r^2+100/(r-100)^2)) (the LHS) is the period. 2pi*sqrt(100^3/1000) is the orbital period of the planet.
This gets us r=135.23367415675359103. It's rather straightforward to get the velocity from there, and to generate the resulting code:
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: 100,y0: 0,vx: 0,vy: -3.1622776601683795,t0: 0,who: 2,m: 100], [x0: 135.23367415675359103,y0: 0,vx: 0,vy: -4.2764642668839177,t0: 0,who: 3,m: 100]
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
Always check your units or you will have no money!
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: Challenge: Lagrange Points
I feel you, Random. I think it has to do with the gravitational constant :\
Convincing people that 0.9999... = 1 since 2012
-
- Posts: 523
- Joined: Mon Jun 03, 2013 4:54 pm
Re: Challenge: Lagrange Points
I don't think that's very likely.. G is equal to 1 uzp^3/(μ*pf^2) (1 Unit-zoom pixel^3/(Mass unit * Pseudoframe^2), totally valid unit in games!robly18 wrote:I feel you, Random. I think it has to do with the gravitational constant :\

$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
Always check your units or you will have no money!
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: Challenge: Lagrange Points
I'm not sure... I did that too, and it failed for me too. What are the odds of both of us messing up?
Convincing people that 0.9999... = 1 since 2012
-
- Posts: 523
- Joined: Mon Jun 03, 2013 4:54 pm
Re: Challenge: Lagrange Points
Probability of you messing up * Probability of me messing up, from general multiplication rule?robly18 wrote:I'm not sure... I did that too, and it failed for me too. What are the odds of both of us messing up?

I'm going to think about this some more..
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
Always check your units or you will have no money!
- testtubegames
- Site Admin
- Posts: 1164
- Joined: Mon Nov 19, 2012 7:54 pm
Re: Challenge: Lagrange Points
This is a curious one. I took a look over the math... and I couldn't find any issues. I worked through it independently, got the same answer... checked references, got the same answer. And the asteroid still stubbornly zooms off into space, instead of staying nicely in L1.
So if it isn't an issue of doing the math wrong, I figure it has to come down to stability. This is, after all, a Lagrange point that is unstable. "But" you may object "the asteroid doesn't even look like it is *trying* to orbit next to the planet." That's what I thought, at least, until I realized that the stability may well be connected to the masses of the objects. As in -- Lagrange points might only be moderately unstable when you're talking about the Earth, Sun, and Moon, because the ratio of masses between the earth and sun is so very small (instead of .1, as in your example, the ratio is more like .00001). It turns out, as you'd expect, the stability (and amount of unstability) does hinge upon these types of issues. (for more on that, check out this mathy site).
I tried to make a system that was a bit more realistic, then. With the ratio of the masses at .001, and the distance increased to 1000 instead of 100, to boot.
The asteroid still breaks free from the lagrange point in less than a rotation (heck, less than 1/4 a rotation!), but it's certainly better. Anyone want to take a crack at making it better? I imagine decreasing the mass even further is the way to go (we've got a couple orders of magnitude still before we reach the earth-sun case)
So if it isn't an issue of doing the math wrong, I figure it has to come down to stability. This is, after all, a Lagrange point that is unstable. "But" you may object "the asteroid doesn't even look like it is *trying* to orbit next to the planet." That's what I thought, at least, until I realized that the stability may well be connected to the masses of the objects. As in -- Lagrange points might only be moderately unstable when you're talking about the Earth, Sun, and Moon, because the ratio of masses between the earth and sun is so very small (instead of .1, as in your example, the ratio is more like .00001). It turns out, as you'd expect, the stability (and amount of unstability) does hinge upon these types of issues. (for more on that, check out this mathy site).
I tried to make a system that was a bit more realistic, then. With the ratio of the masses at .001, and the distance increased to 1000 instead of 100, to boot.
Code: Select all
Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 0.12,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 1000,y0: 0,vx: 0,vy: -1,t0: 0,who: 2,m: 1], [x0: 1070.900553804888,y0: 0,vx: 0,vy: -1.07090055380487,t0: 0,who: 3,m: 0]
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: Challenge: Lagrange Points
I say we just give up and do this in r^1. That should prove easier.
Convincing people that 0.9999... = 1 since 2012