# Superposition of accelerations in multibody problem

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.

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