I am creating a n-body simulation for a school project since I wanted to learn how to program in Java. Basically it's a bunch of instances of astrophysical bodies interacting by gravity.
Right now, I run a update method as fast as possible and set a delta time variable, which declares how many seconds one update represents.
The problem with this however, is that as I spawn more bodies, the update-frequency obviously drops and the time elapsed slows down.
What would be some alternative, better method of updating the forces etc, where a velocity "v" is the same regardless of how many bodies are in the program?
Sorry if the question is confusing, english is not my native language.
Aucun commentaire:
Enregistrer un commentaire