POV-Ray : Newsgroups : povray.binaries.images : Gravity-driven model of the solar system (73kbbu) Server Time
19 Aug 2024 02:22:12 EDT (-0400)
  Gravity-driven model of the solar system (73kbbu) (Message 1 to 4 of 4)  
From: Greg M  Johnson
Subject: Gravity-driven model of the solar system (73kbbu)
Date: 17 Jan 2001 13:33:53
Message: <3A65E429.18F2DC62@my-dejanews.com>
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


 

From: Ben Birdsey
Subject: Re: Gravity-driven model of the solar system (73kbbu)
Date: 17 Jan 2001 15:25:40
Message: <3A660077.BB48AB36@mail.com>
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

From: Greg M  Johnson
Subject: Re: Gravity-driven model of the solar system (73kbbu)
Date: 17 Jan 2001 16:54:12
Message: <3A661321.7E092A8C@my-dejanews.com>
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

From: David Fontaine
Subject: Re: Gravity-driven model of the solar system (73kbbu)
Date: 17 Jan 2001 18:55:05
Message: <3A662F9C.E092DC07@faricy.net>
"Greg M. Johnson" wrote:

> 1. It took me 24 hours to compute this scene spanning 50 years and 20
> particles on a 450 MHz Pentium II.

That's a looong time. Quite seriously, if you have a compiler you probably
want to port it. It'll run several (hundred?) times faster. Then just have POV
read in the data.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.