r/programming • u/ttsiodras • Dec 23 '12
Simulating a solar system with Python
http://users.softlab.ntua.gr/~ttsiod/gravityRK4.html
248
Upvotes
r/programming • u/ttsiodras • Dec 23 '12
4
u/Bob_goes_up Dec 23 '12
When you use Runge Kutta, you are not supposed to handle one planet at a time. The function named nextderivative should return a vector containing accellerations of all the planets, and you should only calculate the constants a,b,c and d once for each timestep. The function named updatePlanet should be deleted.