|
![](/i/fill.gif) |
You're right, there are some very interesting issues here. No way is it easy
to write something that looks good, and doesn't take FOREVER to get results.
The way I see it there are at least three issues.
1) You are right, if his variable "Time" was the total
time, he would be in real trouble.
The variable "Time" isn't the total time, it's the
time between frames. So, if this time is SMALL ENOUGH,
the acceleration is pretty much constant, so the
program IS right.
The real problem was with defining the units correctly.
( i.e. he had accidentally defined the gravitational to
be WAY too strong )
2) The other issue is the issue of realism. In a lot of
particle simulations, you don't really care if the
simulation cheats a bit on the physics. You just
want it to look GOOD. But Peter wants to simulate
something real, and something we all know. So if he
runs the simulation and Mercury falls into the Sun
he's in trouble!
That depends something called the "numerical stability"
of the simulation program. It depends a little bit on
the exact method you use to estimate the new positions and
new velocities, but it mostly depends on the amount of
time between steps.
In this case, I got pretty good results for 1 frame =
3 days, or "clock_delta" = .01 which you get in a 100
frame animation.
One really cool way to check this out is to run the
simulation forward 100 or 1000 steps and then run it
backward by the same number of steps and see if you
get your original data back.
3) This is definitely not the most efficient way of doing
things! You could probably make something that looks pretty
good without solving ANY differential equations. The
orbits of almost all the planets and moons in the
Solar System are pretty circular, which means that they
travel in circles about the body they orbit at a constant
angular velocity {i.e. the earth has an angular velocity
of about 1 degree/day = (360 degrees / 365.24 days) and the
moon has an angular velocity of about 360/28 degree/day
around the earth.}
This method looks good, and is less prone to the
difficulties listed in point 2.
Actually computing the paths of the planets this way
is really only good if you want to see the TINY effect
that the Sun has on the orbit of the Moon, or the REALLY
TINY effect that all the other planets have on the orbit
of Mercury.
With even 10 objects the rendering time is so much longer
than the computation time that it just doesn't matter, but
I wonder what happens when you start tossing in all those
moons and a few asteroids ...
This really is a cool topic. Maybe we could start a thread on simulation
issues or something!
Until that Day,
Ben
Post a reply to this message
|
![](/i/fill.gif) |