r/programming • u/ttsiodras • Dec 23 '12
Simulating a solar system with Python
http://users.softlab.ntua.gr/~ttsiod/gravityRK4.html
244
Upvotes
r/programming • u/ttsiodras • Dec 23 '12
View all comments
Show parent comment
5
u/jminuse Dec 23 '12
I suppose by not including a timestep in the Verlet, he is effectively using a timestep of one, but that's not wise. The cumulative error in position is proportional to a power of the timestep (dt1 for Euler, dt2 for Verlet, dt4 for RK4). With such giant timesteps no wonder he would not get good results. Euler might not even be numerically stable. Verlet is always stable, but this can just hide the problem.