I finally (think) I figured out what is wrong with my planet gravity sim

Started by
1 comment, last by Daerax 18 years, 10 months ago
I have been doing a simulation of the effects of inter-planetary gravity. The problem, I believe, doesn't lie with my algorithm (modeling the whole F=GMm/d^2 thing). Instead (there is no clipping), the planets, esp. when there are only two, get so close together that their distance is a tiny fraction of 1. Therefore, squared, it is even tinier, leading to them all of a sudden getting a sudden burst of speed, since it obviously isn't modeled in "perfect realtime", if you know what I mean. All of a sudden, their force jumps up astronomically, and they zoom away from each other, although in the direction they needed to move to get closer together - they overshoot. Any ideas on how to counteract this? This is supposed to be a realistic simulation (its for a physics project). But the main thing is that it looks realistic, which it certainly doesn't at this time. Thanks!
my siteGenius is 1% inspiration and 99% perspiration
Advertisement
See this thread. The error is numerical in nature and based on your integration scheme, not your fault.
Check this link on a numerical model of solar systems as well.

This topic is closed to new replies.

Advertisement