|
![](/i/fill.gif) |
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
Post a reply to this message
Attachments:
Download 'gravity2.zip' (2 KB)
|
![](/i/fill.gif) |