MATLAB Assignment on Room Modes
SUBMITTED BY – GOURAV KOTRIWAR
ROLL NO. – 202MD005
PROBLEM STATEMENT :
ROOM DIMENSIONS USED
Lx=3.2m
Ly =2.8m
Lz =2.8m
For l=0, m=0, n=1
The frequency of vibration is 61.25 Hz
For l=0, m=1, n=0
The frequency of vibration is 61.25 Hz
For l=1, m=0, n=1
The frequency of vibration is 81.39 Hz
For l=1, m=0, n=0
The frequency of vibration is 53.59 Hz
For l=1, m=1, n=0
The frequency of vibration is 81.39 Hz
For l=2, m=0, n=0
The frequency of vibration is 107.19 Hz
For l=2, m=1, n=0
The frequency of vibration is 123.45 Hz
For l=2, m=0, n=1
The frequency of vibration is 123.45 Hz
For l=1, m=0, n=2
The frequency of vibration is 133.71 Hz
For l=1, m=2, n=0
The frequency of vibration is 133.71 Hz
For l=1, m=2, n=1
The frequency of vibration is 147.07 Hz
For l=2 , m=2, n=2
The frequency of vibration is 203.72 Hz
For l=1, m=1, n=1
The frequency of vibration is 101.86 Hz
MATLAB CODE
lx=input('enter the value of lx: ');
ly=input('enter the value of ly: ');
lz=input('enter the value of lz: ');
l=input('enter the value of l: ');
m=input('enter the value of m: ');
n=input('enter the value of n: ');
c=343;
k=(((l*pi)/lx)^2+((m*pi)/ly)^2+((n*pi)/lz)^2)^0.5;
omega=k*c;
f=(omega/(2*pi));
[X,Y,Z] = meshgrid(0:0.05:lx,0:0.05:ly,0:0.05:lz);
A=1;
P = A*cos(pi*l.*X/lx).*cos(pi*m*Y/ly).*cos(pi*n*Z/lz);
slice(X,Y,Z,P,(0:lx),(0:ly),(0:lz))
fprintf('The frequency of vibration is %1.2f Hz:',f);