Physics, Science, Programming, Deep Dives, Thoughts And Theory.
v_mean if dist=="equal": self.v_mean=v_mean self.v_std=v_std _vel=v_mean*np.ones((n,self.dim)) #Randomly switch velocities to negative with probability 0.5 for i in range(_vel.shape[0]): for j in range(_vel.shape[1]): if np.random.uniform() > 0.5: _vel[i,j]=-_vel[i,j] #Store velocities in temporary