Physics, Science, Programming, Deep Dives, Thoughts And Theory.
_v[c]=-_v[c] #Increment wall momentum self.wall_momentum+=2*_m*np.abs(_v[c]) #Update velocity m.set_velocity(_v) #Update position based on new velocity _x_new=_x + _v * self.t_step #Check collisions with the bottom and left walls if _x_new[_x_new<=0].shape[0] > 0: #Increment collision counter