0
$\begingroup$

I am currently trying to design a game that implements Newtonian gravity, and am trying to code something that draws the trajectory of a small mass being acted upon by the gravity of much larger bodies.

For a single large body, this is no problem: determine the conic section's shape parameter as functions of velocity and position from the large mass. The problem arises when more than one large body enters the system.

So, I had a thought: surely you could determine the trajectories formed by each large mass individually, considering the accelerations individually, then superposing the trajectories by summing the position vectors which are functions of time.

My reasoning for the above is due to saying: $$a(t)_1 + a(t)_2 + ...= a(t)_{net}$$ Differentiate wrt time twice: $$x(t)_1 + x(t)_2 + ...= x(t)_{net}$$

However, this plan does not seem to work as the accelerations are functions of space as well as/instead of time. This can be illustrated if you consider a small mass travelling with an initial velocity. Now consider two systems: one where the is a planet placed in such a way that the small mass circularly orbits it; the other with no large mass, so the mass continues in a straight line. Superpose the systems: the same system arises as in system 1, but superposing the trajectories leads to a different, "epicyclic" trajectory. Hmm...

So my question is, is there any way of relating the trajectories caused by individual large masses with the trajectory due to all the masses. I suspect partial differential might be handy, but I have no way of checking this.

Note: assume the large masses are at rest and stay as such.

$\endgroup$
  • $\begingroup$ $a_1+a_2 + \ldots = a_{net}$ is not a fundamental law of anything. $\endgroup$ – ja72 Apr 20 '15 at 14:45
0
$\begingroup$

You can't prescribe the motion in the general case. You need to build a simulation.

That is calculate the acceleration of each body at every instant and integrate over a small time period to find the change in position and velocity. Then re-calculate the accelerations given the new positions (and velocities) and repeat for many small time steps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.