Challenge: Model Solar System

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

Re: Challenge: Model Solar System

Post by A Random Player »

testtubegames wrote:Yes, good catch there. I went through your math, and ran that simulation with a stopwatch, and found the same discrepancy. And you've got the reason right. It turns out the 'time' in the simulator doesn't exactly match the 'time' in the outside world. There's a conversion you have to do.

So, digging back into it, I see that the simulation runs at (basically) 40 FPS. And during each of those frames, the simulator calculates trajectories and moves the planets .9 seconds ahead. So for every second in the real world, you're seeing 36 seconds in the simulator world. So the orbits you see would go 36 times more rapidly than expected (from your calculations). It looks like your experiment was pretty darn accurate.

Also, this holds for the t0 value in the load-codes, too. So if you put in two identical versions of that asteroid, but offset the t0 by 5.6 units, they will not be a full orbit off. But if you offset it by about 200, the second one will appear just after the first completes an orbit:

Code: Select all

Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 21,ySet: 4], [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: 3,m: 0], [x0: 100,y0: 0,vx: 0,vy: -3.1622776601683795,t0: 203.4,who: 3,m: 0]
Oh, that's why. Though the choice of .9 is unusual, why does it use .9, instead of 1 second per frame?
(Off to calculate suitable scaling factors!)
$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: Challenge: Model Solar System

Post by testtubegames »

A Random Player wrote:Oh, that's why. Though the choice of .9 is unusual, why does it use .9, instead of 1 second per frame?
(Off to calculate suitable scaling factors!)
Haha, I same response! I kicked myself a bit when I saw it, but it was just one of those 'it grew organically' things. Early on, I put in a variable 'timestep' to give my program flexibility. I tried a handful of values (.3 goes too slow, 2 goes too fast), and must have just settled on .9.

In retrospect, it would have been nice to scale the time to the world, especially when it is already so close. I just didn't realize at the time that people would be so precise about their scale models ;) Something good to change in the update, though: getting a second to equal a second.
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Challenge: Model Solar System

Post by A Random Player »

What I have so far:
A good scale:
1 unit distance = 1/100 AU
1 unit mass = Mass Earth
1 unit time = ??? seconds

1.993e-44 AU^3/(kg s^2) (WolframAlpha is awesome!)
-> ?? cAU^3/(Mass earth s^2)
Well.. Back to good ol' dimensional analysis.
[1.993e-44 AU^3/(kg s^2)]*[100 cAU/AU]^3*[5.972e24 kg/ME]
= 1.190e-13 cAU^3/(ME s^2)

Now to make this equal to 1 cAU^3/(ME Timestep^2).
sqrt([1 cAU^3/(ME Timestep^2)]/[1.190e-13 cAU^3/(ME s^2)])
=2.899e6 seconds/timestep, or 0.09192 years. Pretty good, not too fast, not too slow.
What I just need know is the relative orientations of the orbits. Though I suppose I could just point them randomly.
$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: Challenge: Model Solar System

Post by testtubegames »

A Random Player wrote:What I have so far:
A good scale:
1 unit distance = 1/100 AU
1 unit mass = Mass Earth
1 unit time = ??? seconds

1.993e-44 AU^3/(kg s^2) (WolframAlpha is awesome!)
-> ?? cAU^3/(Mass earth s^2)
Well.. Back to good ol' dimensional analysis.
[1.993e-44 AU^3/(kg s^2)]*[100 cAU/AU]^3*[5.972e24 kg/ME]
= 1.190e-13 cAU^3/(ME s^2)

Now to make this equal to 1 cAU^3/(ME Timestep^2).
sqrt([1 cAU^3/(ME Timestep^2)]/[1.190e-13 cAU^3/(ME s^2)])
=2.899e6 seconds/timestep, or 0.09192 years. Pretty good, not too fast, not too slow.
What I just need know is the relative orientations of the orbits. Though I suppose I could just point them randomly.
So that would make about 1000 timesteps per year? Yeah, that would be frequent enough to keep the planets well in their orbits. Though I can't quite predict how wayward tugs from Jupiter might change things.

As for where to place them... seems to me like it'd be fun to pick a particular date. Though, a quick google hunt for "where are the planets today" leads pretty exclusively to astrology sites. Oops! Maybe 'random' starting locales would be the easier way to go.
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Challenge: Model Solar System

Post by robly18 »

I don't think it would be too hard. I'm not too sure about this, but from what I know, 2012 was a big deal because it was this huge planetary alignment where all the planets were aligned. Don't take my word on it, though.
Convincing people that 0.9999... = 1 since 2012
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Challenge: Model Solar System

Post by A Random Player »

testtubegames wrote: So that would make about 1000 timesteps per year? Yeah, that would be frequent enough to keep the planets well in their orbits. Though I can't quite predict how wayward tugs from Jupiter might change things.

As for where to place them... seems to me like it'd be fun to pick a particular date. Though, a quick google hunt for "where are the planets today" leads pretty exclusively to astrology sites. Oops! Maybe 'random' starting locales would be the easier way to go.
It'd probably affect the other planets only about as much as it does in real life, seeing how this is (supposed to be at least) really accurate. Also because Jupiter is 9.55e-4 times the mass of the sun, and quite far away from the inner planets.

'Random' initialization seems it would work, and would affect much - The eccentricities are still very close to 0.
robly18 wrote:I don't think it would be too hard. I'm not too sure about this, but from what I know, 2012 was a big deal because it was this huge planetary alignment where all the planets were aligned. Don't take my word on it, though.
Interesting...
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
19683
Posts: 151
Joined: Wed Jun 05, 2013 12:15 pm

Re: Challenge: Model Solar System

Post by 19683 »

robly18 wrote:I don't think it would be too hard. I'm not too sure about this, but from what I know, 2012 was a big deal because it was this huge planetary alignment where all the planets were aligned. Don't take my word on it, though.
Don't you mean the galactic alignment on 12/21/12? (when the sun lined up with the center of the galaxy)
Binomial Theorem: ((a+b)^n)= sum k=0->k=n((n!(a^(n-k))(b^k))/(k!(n-k)!))
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Challenge: Model Solar System

Post by robly18 »

19683 wrote:
robly18 wrote:I don't think it would be too hard. I'm not too sure about this, but from what I know, 2012 was a big deal because it was this huge planetary alignment where all the planets were aligned. Don't take my word on it, though.
Don't you mean the galactic alignment on 12/21/12? (when the sun lined up with the center of the galaxy)
I think it was both. I think I saw on the history channel that in that alignment, not only did the sun line up with the galactic center, but the planets all aligned with eachother.
Convincing people that 0.9999... = 1 since 2012
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Challenge: Model Solar System

Post by A Random Player »

robly18 wrote:
19683 wrote:
robly18 wrote:I don't think it would be too hard. I'm not too sure about this, but from what I know, 2012 was a big deal because it was this huge planetary alignment where all the planets were aligned. Don't take my word on it, though.
Don't you mean the galactic alignment on 12/21/12? (when the sun lined up with the center of the galaxy)
I think it was both. I think I saw on the history channel that in that alignment, not only did the sun line up with the galactic center, but the planets all aligned with eachother.
Isn't that supposed to be extremely unlikely (and I think due to resonance, maybe even impossible)?

Edit: Woah, your post was 100th in this subforum!
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Challenge: Model Solar System

Post by robly18 »

Cool. Them strange alignments.
Convincing people that 0.9999... = 1 since 2012
Post Reply