Update comments and add cylinder
This commit is contained in:
parent
d91d0112ef
commit
60b15edf07
2 changed files with 27 additions and 1 deletions
2
cube.py
2
cube.py
|
|
@ -1,6 +1,6 @@
|
|||
from math import *
|
||||
|
||||
## Exp W. Modes of long cyclinder (1D) ##
|
||||
## Exp W. Modes of long Cube ##
|
||||
u = 343 #speed of sound
|
||||
a = 0.2 #length width and height of cube
|
||||
b = 0.2
|
||||
|
|
|
|||
26
cylinder.py
Normal file
26
cylinder.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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])
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue