% Calculates the kinetic energy of the system.
function KE = KEnergy(pn, m, N);
kin = 0;
for i = 1:N
  kin = kin + 1/(2*m(1,i))*(pn(i,1)^2 + pn(i,2)^2 + pn(i,3)^2);
end;
KE = kin;