Physics, Science, Programming, Deep Dives, Thoughts And Theory.
collision_pairs=np.argwhere(self.distance_matrix < 2*self.particle_radius) #If collision pairs exist if len(collision_pairs): #Go through pairs and remove repeats of indices #(for eg., only consider (1,2), remove (2,1)) pair_list=[] for pair in collision_pairs: add_pair=True for p in pair_list: if