26 lines
718 B
Python
26 lines
718 B
Python
from math import *
|
|
|
|
## Exp W. Modes of short cylinder ##
|
|
u = 343 #speed of sound
|
|
l = 0.05
|
|
rho = 0.1
|
|
alpha = [[0, 1.84, 3.05, 4.20],
|
|
[3.83, 5.33, 6.71, 8.02],
|
|
[7.01, 8.54, 9.97, 11.35]]
|
|
fqn = [] #frequencies and respective quantum numbers
|
|
f = [] # frequencies
|
|
|
|
for n in range (0,4):
|
|
for m in range (0,4):
|
|
for j in range (1,4):
|
|
qn = [n,m,j]
|
|
frequency = u*sqrt((n**2/(4*l**2))+(((alpha[j-1][m])**2)/4*pi**2*rho**2))
|
|
if frequency in f: # check for duplicatesq
|
|
continue
|
|
else:
|
|
f.append(frequency)
|
|
fqn.append([frequency,f'n={n}, m={m}, j={j}'])
|
|
|
|
for i in range(len(fqn)):
|
|
print(sorted(fqn)[i])
|
|
|