Welcome, Guest

Author Topic: please help me understand about mass and orbits  (Read 8307 times)

cyborg

  • *
  • Posts: 8
please help me understand about mass and orbits
« on: July 08, 2011, 07:34:01 PM »
As I understood it, and this is probably wrong, if I increase the mass of the sun to some astronomical level while keeping density locked, the orbit of nearby celestial objects should gradually whirlpool into the sun. What I observed in the simulator is all of these celestial objects leave their orbits at a tangent to the sun.

I finished the steam achievement using the editor, so this is not about that. This is about trying to figure out why all of my celestial bodies go spinning out of the solar system when I increase the mass of the sun by the thousands. Please help me understand! ???

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: please help me understand about mass and orbits
« Reply #1 on: July 09, 2011, 12:19:25 PM »
That seems weird... If you increased the mass and locked the density, then that means diameter got larger with mass. So, one of two things should happen. If you were doing it slower, the objects should have gradually inherited more eccentric orbits (elongated) and crashed into the sun. Or, if you were doing it much quicker, the diameter of the sun should have absorbed the objects as it got bigger. So, I'm not sure what could be happening.

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #2 on: July 09, 2011, 05:42:44 PM »
Universe Sandbox, playing with mass

Here is a video of what I'm talking about. I noticed another new person ask the same question today, so it might help both of us if someone knows what's going on here.

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: please help me understand about mass and orbits
« Reply #3 on: July 09, 2011, 06:44:45 PM »
Possibly that the time step is high enough that there are no longer enough calculations per orbit so they fly out before the Sun's diameter reaches that point.

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: please help me understand about mass and orbits
« Reply #4 on: July 09, 2011, 07:31:01 PM »
Hmmm the video is much different than what I thought you were doing. The new star (Earth) is too small, most objects will suddenly accelerate towards it, but not collide with it (if they are going to fast, and the timestep causes them to skip through the area of the star, or they go around it slightly). They continue with their new speed and then they're long gone.

Home run! :P

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #5 on: July 09, 2011, 07:46:57 PM »
Hmmm the video is much different than what I thought you were doing. The new star (Earth) is too small, most objects will suddenly accelerate towards it, but not collide with it (if they are going to fast, and the timestep causes them to skip through the area of the star, or they go around it slightly). They continue with their new speed and then they're long gone.

Home run! :P

I don't understand the time step. To me, the calculations should be the same no matter how many times I run it. Could you explain what this is and how do I represent what I am intending?

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: please help me understand about mass and orbits
« Reply #6 on: July 09, 2011, 07:59:36 PM »
Timestep is used to multiply by the acceleration calculated by F = g*(m1m2)/(r^2)

After the force is converted to acceleration through F=ma, you multiply by timestep. If the mass of the star is large, the force on a smaller object is large, and thus the acceleration is large. It doesn't move every object smoothly, everything is quantized, because our technology sucks and it's not magical. :P

The acceleration is used to move the object to a new point in space, if the acceleration is too much, it might move it THROUGH another object, and they won't register as colliding.

That's the best I can explain it. Dan can elaborate.

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #7 on: July 09, 2011, 08:13:09 PM »
Timestep is used to multiply by the acceleration calculated by F = g*(m1m2)/(r^2)

After the force is converted to acceleration through F=ma, you multiply by timestep. If the mass of the star is large, the force on a smaller object is large, and thus the acceleration is large. It doesn't move every object smoothly, everything is quantized, because our technology sucks and it's not magical. :P

The acceleration is used to move the object to a new point in space, if the acceleration is too much, it might move it THROUGH another object, and they won't register as colliding.

That's the best I can explain it. Dan can elaborate.

So, to get the effect that I want, timestep should be 1. where do I set this value?

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: please help me understand about mass and orbits
« Reply #8 on: July 09, 2011, 08:51:26 PM »
The timestep in your video is actually 1 day, you may want much smaller timesteps like 15 mins, or maybe even less. You can find the timestep right under the simulation time.

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #9 on: July 10, 2011, 07:27:20 AM »
Okay, yeah, something is weird about the timestep. I tried my simulation again, and my expected results were more in line when I set the time to be 15 min. or less. As soon as I increased to anything larger, everything started to slingshot. I thought that the time just calculated at different time intervals where the object would be, but it does look like the time can actually affect a lot more variables than that.

If anyone knows why, feel free to chime in.

Bullethead

  • ***
  • Posts: 20
Re: please help me understand about mass and orbits
« Reply #10 on: July 10, 2011, 01:48:47 PM »
I thought that the time just calculated at different time intervals where the object would be, but it does look like the time can actually affect a lot more variables than that.

Well, remember that velocity is distance * time and acceleration is distance * time^2.  Thus, any change in the time step will have significant effects on both of these, especially acceleration.  And the effect of acceleration is to change the velocity of an object, so that trickles down into big velocity changes.

Besides multiplying by the fudge factor NeutronStar mentioned, as the time step increases, most games have to stop doing all calculations, just ignoring things that the designer deems insignificant.  Thus, you end up with very innacurate results at higher time steps.

Think about this....  In your typical thing like a flightsim or large-scale naval battle sim, the default game speed is realtime.  Most computers these days have enough horsepower to run such games at up to about 5x time acceleration and still do all calculations on all game objects without any fudge factors or skipping any calculations.  But beyond that, the game engine has to cut some corners.  And this is only at 5x.

Now, in US, you can get into timesteps that are hundreds of thousands of times realtime.  Even going from 1 minute to 1 hour is an increase of 60x.  So obviously the game has got to cut a lot of corners.

It would appear, therefore, that if you want to make a highly detailed solar system with all the moons of all the gas giants and such, you have to keep the time running slowly, too slow to watch everything go around the sun in a reasonable amount of time.  But in this case, you're really interested in the details of the moon systems and such anyway.  If you want to see large-scale movement, just put the major bodies in.

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #11 on: July 11, 2011, 05:57:35 AM »
I thought that the time just calculated at different time intervals where the object would be, but it does look like the time can actually affect a lot more variables than that.

Well, remember that velocity is distance * time and acceleration is distance * time^2.  Thus, any change in the time step will have significant effects on both of these, especially acceleration.  And the effect of acceleration is to change the velocity of an object, so that trickles down into big velocity changes.

I hope you don't mind if we continue the discussion just a little bit. I did take physics in college, and as I understand it, the time variable in those calculations is used as a measure of how much time has passed between some interval. Rephrased, if you wanted to know when a racecar would pass a finish line, you could predict the future quite easily. Changing the timestep in this game appears on the interface as being how much time passes between updates on the screen, not as how much time passes as it relates to speed related calculations.

If the timestep variable is actually changing the time value in a physics calculation, by all means let me know.

Bullethead

  • ***
  • Posts: 20
Re: please help me understand about mass and orbits
« Reply #12 on: July 11, 2011, 09:38:10 AM »
Changing the timestep in this game appears on the interface as being how much time passes between updates on the screen, not as how much time passes as it relates to speed related calculations.

The time step changes how much time passes between calculations, so in that way it does affect the time variable.  Think about it like this....

Real gravity works continuously, every fraction of a second of every day.  In US, however, gravity only works for an instant and then there's a gap, then another instant or work, repeat.  Even with the time step at its lowest setting, this is the case because the game has to go through making calculations for everything, then do it again.  Increasing the time step thus increases the time between calculations, and therefore also the time between the instants in which gravity works.

Now suppose you have a small moon with an orbital period of say 4 days.  This is a pretty tight circle so gravity needs to act on it many times as it goes around to give it a nice, circular orbit.  But if you put the time step up to say 1 day, then it's only checked 4 times per orbit.  That isn't often enough to keep it on track so the moon will fly of at a tangent.

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
Re: please help me understand about mass and orbits
« Reply #13 on: July 11, 2011, 04:38:17 PM »
Real gravity works continuously, every fraction of a second of every day.  In US, however, gravity only works for an instant and then there's a gap, then another instant or work, repeat.  Even with the time step at its lowest setting, this is the case because the game has to go through making calculations for everything, then do it again.  Increasing the time step thus increases the time between calculations, and therefore also the time between the instants in which gravity works.

Now suppose you have a small moon with an orbital period of say 4 days.  This is a pretty tight circle so gravity needs to act on it many times as it goes around to give it a nice, circular orbit.  But if you put the time step up to say 1 day, then it's only checked 4 times per orbit.  That isn't often enough to keep it on track so the moon will fly of at a tangent.

This is exactly what's happening in Universe Sandbox.

Bullethead

  • ***
  • Posts: 20
Re: please help me understand about mass and orbits
« Reply #14 on: July 13, 2011, 01:40:22 PM »
This is exactly what's
happening in Universe Sandbox.

Thanks for the confirmation, Oh Great Architect :).  And thanks for US as well.  I'm loving it.

While I"ve got your attention, could you tell us what is the "do not exceed" limit is for the ratio of time step to the shortest orbital period in a given simulation?  IOW, how many times does gravity need to be checked during an orbit to keep the orbit stable?  See, I'm rather lazy and don't want to have to go through many trials to figure this out myself.

On a related note, would it be possible in a future version to have a pop-up warning message when you adjust the time step too high?  Something along the lines of "times steps of this value and above will cause objects to leave their orbits".

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: please help me understand about mass and orbits
« Reply #15 on: July 16, 2011, 12:23:19 AM »
I'd say at least 16 times for the fastest orbit. Twelve if it isn't super close to the object.

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #16 on: July 16, 2011, 02:29:11 PM »
I'd say at least 16 times for the fastest orbit. Twelve if it isn't super close to the object.

Wouldn't it depend on the amount of revolutions compared to the granularity of the distance between objects? It's arbitrary enough that it feels troubling to know my universe will fall apart at some unknown timestep.

Omnigeek6

  • *****
  • Posts: 111
Re: please help me understand about mass and orbits
« Reply #17 on: July 16, 2011, 07:21:55 PM »
I'd say at least 16 times for the fastest orbit. Twelve if it isn't super close to the object.

Wouldn't it depend on the amount of revolutions compared to the granularity of the distance between objects? It's arbitrary enough that it feels troubling to know my universe will fall apart at some unknown timestep.

Do at least 100 calculations per orbit for safety, and you should be fine.

cyborg

  • *
  • Posts: 8
Re: please help me understand about mass and orbits
« Reply #18 on: July 17, 2011, 06:48:05 PM »
I'd say at least 16 times for the fastest orbit. Twelve if it isn't super close to the object.

Wouldn't it depend on the amount of revolutions compared to the granularity of the distance between objects? It's arbitrary enough that it feels troubling to know my universe will fall apart at some unknown timestep.

Do at least 100 calculations per orbit for safety, and you should be fine.

Where do you see the calculation count?

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
Re: please help me understand about mass and orbits
« Reply #19 on: July 20, 2011, 04:02:45 PM »
There is no calculation count display or number.

You can estimate the calculation count this way:
1 Select the object
2 Take the orbital period (orb per) and divide by the time step

This is the approximate calculation count per full orbit.