I'm creating a simple astronomy simulator that should use Newtonian physics to simulate movement of planets in a system (or any objects, for that matter). All the bodies are circles in an Euclidean plane, that have properties such as position, velocity, mass, radius and the resultant force.I want to update the universe in small time steps, usually a few milliseconds, but I'm not sure how to correctly calculate the changes in position.The force is simple: fr = sum(G * body.m * bodyi.m / dist(body, bodyi)^2).But how do I go on from there?I could do this:a = Fr/body.mv += a*dtposition += v*dtBut that would, of course, be false. Maybe if I added 0.5 as a factor in position calculation?
What is the correct way of integrating in astronomy simulations?
time integration