**Quote from EDG on 01/29/11 at 17:30:54:**Yeah, I thought that was what was going on...

Right now if I create Earth at 1 AU from the Sun, it seems that a timestep of 1 causes it to visibly move around the sun (it seems that timestep 1 is about 20 days, in this case with just the Earth around the sun). If I slow down the timestep to about 1/204800 (I think? The display doesn't actually show the timestep below 0.01) then that seems to correspond to a simulated second being the same as a real second (approximately).

I guess if I have more objects then that equivalence won't be the same since the extra objects will slow down the processing speed?

Any discussion of timestep should start with an explanation of the method Gravsim uses to calculate the positions of the objects. It uses what is known as the Euler method. Here's a non-mathematical explanation.

Let's start with two bodies. (We'll keep it to two dimensions here, but it works the same in three.) We know their positions and we know their velocities, so we can plot them on a graph:

We calculate the acceleration of gravity between the objects...

... then we add that accleration to the velocity, which gives us the new position of the objects:

The stepsize determines how much time we let pass between these calculations. So if we cut the stepsize in half, then we are only letting the objects travel half as far:

As before, we calculate the acceleration of gravity:

and add it to the original velocities to get the new velocity:

If we repeat the process a second time, we are now "caught up" to the first sim:

We've calculated two frames instead of one to reach the same point in time, which doubles the cost in processor time... but it also gives us a more accurate rendering of the positions of our objects.

If we continue to cut the stepsize down, we can get progressively closer to the true path these objects would follow:

THIS is the value that you are adjusting when you change the time step. It is given in units of seconds, which you'll see if you raise it high enough. (It will convert to days or years at high values, in which cases it shows the units.)

In general, you should always set this to the smallest possible number to get an acceptable simulation speed. This is why I have said in at least a couple of posts that you should always adjust the Graphics Interval (in the Preferences menu... and if you're reading this Tony, I'd love to see a dashboard element for this...) to the highest number possible that still gives you an acceptable FRAME RATE. (Don't confuse this with "time step"; I'm talking about frame rates as in film/animation here.) With small numbers of bodies you might be surprised how high this can be. In three-body simulations I usually have it up around 10000. This frees up a LOT of processor time, so you can drop the time step to very low values, which increases the accuracy of your simulations.

So, to sum it up with a good rule of thumb:

Movement too fast: DECREASE the TIME STEP.

Movement too slow: INCREASE the GRAPHICS INTERVAL.