|
![](/i/fill.gif) |
I'm posting to p.b.s.-f. a pov file which models the effects of gravity
on particles in our own solar system.
The image below is from a scene file where the Sun, nine planets, and 10
dinosaur-killer-size asteroids are orbiting for a period of 50 earth
years. The planets are the light blue/green streaks, the asteroids are
red & yellow. Jupiter is the outermost orbit in this field of view. I
was motivated to start working on this kind of model when someone said
Jupiter was a blessing to earthlings in that its gravitational field
protected us fom much asteroid bombardment. (The attached file doesn't
answer this question yet.)
The code shares its roots with my boid system, which is explained at :
http://www.geocities.com/pterandon/boids.html
The strengths of the model (and pov file) include:
-----------------------------------------------------------------
1. Actual use of gravity-based equations to determine instantaneous
velocities of particles, rather than simple rotation transforms of
povray objects.
2. Gravitational interactions between all particles are calculated, not
just merely wrt/ the Sun, although it should be possible to see how this
isn't too difficult to comment out, thus speeding up the calcs.
3. It is versatile in what you can to with the information:
a) display a trace of the movement of particles (as shown in this JPG),
or
b) write to a file the positions and velocities of each particle at any
increment desired (Note: some tweaking on the code on your part is
required, but basic #fopen commands, etc. are there in the file).
4. The orbits for planets from earth and increasing radius are stable
enough for most considerations.
5. The file contains information on the radius of the planets & Sun
scaled to the scale of this system (1 pov unit= 1 Gigameter).
Weaknesses of the model include:
---------------------------------------------
1. It took me 24 hours to compute this scene spanning 50 years and 20
particles on a 450 MHz Pentium II.
2. Planets drift. This slow speed is required for stable orbits in the
inner planets. You can note in this photo that Mercury (Medium Blue) is
starting to drift out into the orbit of Venus (Light Blue). Venus is
also starting to drift into the orbit of Earth, which BTW has a nice
stable orbit (Light Torquoise). This is a fundamental problem with all
of the orbits: THEY ALL DRIFT, the inner ones more severely. Weeks of
experimentation plus my own understanding confirm that this is an
unavoidable problem with this kind of calculation, and IS NOT a problem
with my gravitational constant, placing planets at incorrect velocities
or positions. The algorithm essentially computes the forces acting on
every particle at increments of 38 MINUTES (i.e., one earth orbit or
year = 13600 ticks of the count variable "tt"). To get a perfect system
(perfect elliptical orbit), one must take the limit of the system as it
approaches zero, or in other words, compute the forces every ZERO
SECONDS. Drawing particles that orbit the sun on perfect ellipses
prevents one from considering inter-particle gravitational interactions,
the original purpose of this POV file. To the extent of the problems
listed herein, the file is your own "fixer-upper"!
3. Since it will rarely be the case that you will be interested in the
position of particles every 38 minutes, care must be taken to set up the
code for display or writing of variables to occur only once every 100,
1000, etc., counts as desired.
Post a reply to this message
Attachments:
Download 'boid13c18l.jpg' (73 KB)
Preview of image 'boid13c18l.jpg'
![boid13c18l.jpg](/povray.binaries.images/attachment/%3C3A65E429.18F2DC62%40my-dejanews.com%3E/boid13c18l.jpg?ttop=443840&toff=11350&preview=1)
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Are you certain that your model is conserving energy? I have worked
with many finite-difference models in the past, and from my experience
it is very possible and even probable that you are not conserving
energy.
I don't know what scheme you are using to determine the orbits, but you
might want to consider using a different one. Two of the simpler ones
are called
- the velocity Verlet algorithm
- the 4th order Runge-Kutta algorithm
Besides this, I'm sure that there are a variety of special algorithms
for planetary motion.
Good luck.
In Him,
Ben
<><
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ben Birdsey wrote:
> Are you certain that your model is conserving energy?
I'm just doing a tug, move, tug, move.
1. The position is moved along a few percent of the velocity.
#declare actorp[n]=actorp[n]+.05*actorv[n];
2. The velocity is modified by the acceleration, which is a made-up gravitational
constant times a vector which is the sum of the inverse square of all forces acting
on it.
#declare actorv[n]=actorv[n] + Grav*(actoravoid[n]);
In other words, actoravoid[n] is computed by:
#declare i=0 ;
#while (i<num)
#declare j=i+1 ;
#while (j<num)
#local dji=vlength(actorp[j]-actorp[i]);
#local vij=vnormalize(actorp[i]-actorp[j]);
#declare actoravoid[j]=actoravoid[j]+mass[i]*vij/(dji^2);
#declare actoravoid[i]=actoravoid[i]-mass[j]*vij/(dji^2);
//note negative here because dirn of vji reversed
#declare j=j+1;
#end
#declare i=i+1;
#end
Now you've pointed me to some very interesting links, by searching for those terms.
A) Some uses of these algorithms are irrelevant to my scenario, as they apply to
ONE particle condemned to orbit only ONE object. I wanted every particle to be
instantaneously affected by every other one. I wanted Shumaker-Levy (sp?) to be
caught by Jupiter, not merely orbit the sun.
B) Some use my algorithm verboten,
C) Some uses of this algorithm suggest using, in my terminology:
#declare actorv[n]=Grav*(actoravoid[n]),
which I don't see how this computes an "orbit".
D) Some are just plain over my head.
> Besides this, I'm sure that there are a variety of special algorithms
> for planetary motion.
Can they do the "Jupiter catches S-L" thing?
Links?
Post a reply to this message
|
![](/i/fill.gif) |