The "pendulum" described above is sort of unphysical. The two huge masses can't stay at rest, they should be attracted by gravitation. So here is another system, three masses (restricted to a plane) but following Newtons law
n = 3;(* number of masses *)
dim = 2; (* dimension of space - here a plane *)
pos = Table[x[i, j][t], {i, 1, n}, {j, 1, dim}];
mass = {10^-4, 1., 1.05}; (* Params of the system *)
grav = 1.; (* constant of gravity *)
force[i_] :=
- Sum[If[j == i,0, (grav mass[[j]])/ Sqrt[(pos[[i]] - pos[[j]]).(pos[[i]] - pos[[j]])] (pos[[i]] - pos[[j]])], {j, 1, n}]
Initial conditions
initpos = Thread /@ Thread[(pos /. t -> 0) == {{0, 5}, {-2, 0}, {2, 0}}];
initspeed = Thread /@ Thread[(D[pos, t] /. t -> 0) == {{0, .2}, {0, -.15}, {0, .15}}];
ODE and its solution
sys = Flatten[Join[DGL, initpos, initspeed]];
sol = Flatten[NDSolve[sys, Flatten[pos /. a_[t] -> a], {t, 0, 200}]];
xx = Partition[(Flatten[pos]) /. sol, dim];
and look at it
Animate[
Graphics[{PointSize[.05], Point /@ xx /. t -> tt},
PlotRange -> {{-6, 6}, {-10, 10}}],
{tt, 0, 50}]
It seems that the small mass finally picks up so much speed that it leaves the system