POV-Ray : Newsgroups : povray.binaries.scene-files : My gravity calculations don't work... help! : Re: My gravity calculations don't work... help! Server Time
3 Sep 2024 02:15:39 EDT (-0400)
  Re: My gravity calculations don't work... help!  
From: Greg M  Johnson
Date: 5 May 1999 12:23:34
Message: <373061D8.6F884171@geocities.com>
Peter's algorithm states:
#declare NewVel[i] = OldVel[i] + Acceleration*Time;
#declare NewPos[i] = OldPos[i] + OldVel[i]*Time + 0.5*Acceleration*Time*Time;

I  think    d= d0  +vt + at^2  only applies in the case of constant acceleration!

I prefer:
#declare NewVel[i] =  OldVel[i] + Acceleration*Some_Constant;
#declare NewPos[i] =  OldPos[i]+NewVel[i]*Acceleration*Some_Other_Constant;

Also, I tend not to bother with the "time", as I run my particle systems inside a
#while
loop. It eliminates the need to write to a file for each frame. For example, in a 250
frame
animation, I say,

#while(Gregs_Frame_Increment < 250*clock+1)

Ben Birdsey wrote:

>         I seem to have gotten the program working.  There was a problem with the
size
> of "GravConst" (i.e. = 6.670e0 instead of = 6.670e-11).  I also took the liberty
> of changing the units that the data is stored in (all in AU's and years and
> earth masses.  This is easier for us because that's what's in the tables, but
> the computer has to convert).
>
>         I don't know what problems you were experiencing, but at first, my mercury
kept
> breaking out of orbit!  I was trying to use an algorithm called "Velocity
> Verlet" to integrate, but it was unstable at a time step of even 8 hours!  So, I
> went back to your original method and it works.
>
>         In Him,
>         Ben
>
>   ------------------------------------------------------------------------
>
>                       Name: gravity2.zip
>    gravity2.zip       Type: Zip Compressed Data (application/x-zip-compressed)
>                   Encoding: base64


Post a reply to this message

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