Does anyone know why perihelion moves in this simulation? I learned that perihelion movement can only be explained by general relativity, not newtonian mechanics. Is this just a limit of computer simulation? (which can't calculate the exact value of Gm1m2/r^2)
It is a shortcoming of the integrator (Euler), not in the calculation of the force (as you suspected). See [1]. Especially slides 11 and 12 may be of interest. [1] http://www.astro.sunysb.edu/phy277/lect30.pdf As a sidenote, there are better integration schemes, but all of them will have some error because we discretize the system.
Gravity Simulator
131–135 of 135 posts
Re: Gravity Simulator
#132Love this. I managed to get a pretty stable orbit by using the right angle and velocity (by chance). Highlighted in yellow: http://i.imgur.com/OOaTLMP.png
This is the coolest trajectory found on this thread for now!!!!
Re: Gravity Simulator
#133Re: Gravity Simulator
#134Wow this is fun. But it has so much potential for improvements! -Saving your setting -Undo-ing -Auto generate small object in perfect circle orbit around larger object, and generate sun-earth-moon system -Export setting to other people -Allow to numerically finetune locations and velocities -Don't ruin the trails when dragging -Make it run faster, especially with trails enabled -etc... :) EDIT: Gee, when will Hacker…
Re: Gravity Simulator
#135Earlier quoted context omitted.
It is a shortcoming of the integrator (Euler), not in the calculation of the force (as you suspected). See [1]. Especially slides 11 and 12 may be of interest. [1] http://www.astro.sunysb.edu/phy277/lect30.pdf As a sidenote, there are better integration schemes, but all of them will have some error because we discretize the system.
Wow that is really interesting. Thanks. By the way, if there are always some error in all systems, then what kind of systems are used by NASA or other space exploration institutes?
But in general, you can control the error and make a trade-off between computing time and accuracy. You would select a timescale over which you want the error to be below some value, and then only consider the simulation valid until then.