def net_forces(self): """ produces a matrix of force components for all bodies """ self._f_matrix.fill(0) count = 0 for body in self._body_list: for body2 in self._body_list: if body != body2: net_force = Physics.gravitational_force( body.get_mass(), body2.get_mass(), self.euclidean_distance(body.get_position(), body2.get_position()), self.get_dist_change(body.get_position(), body2.get_position())) self._f_matrix[:, count] += net_force count += 1 self._analytics.add_data(self._t, la.norm(self._f_matrix[:, 1]))