from math import * ## Exp W. Modes of long cyclinder (1D) ## u = 343 #speed of sound a = 0.2 #length width and height of cube b = 0.2 c = 0.2 fqn = [] #frequencies and respective quantum numbers f = [] # frequencies for l in range (0,4): for m in range (0,4): for n in range (0,4): qn = [l,m,n] frequency = (u/2)*(sqrt((l/a)**2+(m/b)**2+(n/c)**2)) if frequency in f: # check for duplicatesq continue else: f.append(frequency) fqn.append([frequency,qn]) for i in range(len(fqn)): print(sorted(fqn)[i])