Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is my code: function Visous_Inertial_Thermal_Dissipation_Model( L,d,Q ) % T

ID: 3620424 • Letter: H

Question

Here is my code: function Visous_Inertial_Thermal_Dissipation_Model( L,d,Q )
% This program computes the absorption coefficients over a desired range of frequencies of a uniform porous celullar
% solid based on Biot/Zwikker-Kosten single porosity model. Where L is the
% thickness of the sample, a is the pore size, d is the size of the air gap
% behind the sample and Q is the porosity.
alpha=[];
a=0.0001;
while a<=5;
for f=1:100:2000;
u=1.9e-05;
x=(8*u)/a^2;
G=1.4;
Pr=.702;
Po=101320;
qo=1.2;
Ua=((4*pi*qo*f)/(x))^(1/2);
za=(1+i)*Ua;
Ja=besselj(1,za);
Fa=(2*Ja)/((1+i)*Ua*Ja);
pw=(qo/Q)/(1-Fa);
Ub=(Pr*Ua);
zb=(1+i)*Ub;
Jb=besselj(0,zb);
Fb=(2*Jb)/((1+i)*Ub*Jb);
kw=(G*Po/Q)/(1+(G-1)*Fb);
Zw=(pw*kw)^(1/2);
mw=i*2*pi*f*(pw/kw)^(1/2);
co=343;
Zr=-(qo*co)*i*cot((2*pi*f*d)/(co));
Zs=Zw*((Zr*cosh(mw*L)+Zw*sinh(mw*L))/(Zr*sinh(mw*L)+Zw*cosh(mw*L)));
Zo=qo*co;
alpha=[alpha,1-abs((Zs-Zo)/(Zs+Zo))^(2)];
end
a=a+0.25;
end
alpha
I'm trying to make (alpha) a [1x400] matrix, but after the for loop goes through one iteration and the while loop sends it back to the begining of the for loop with a new (a) value, the values for (alpha) become NaN.
Any suggestions as to what I might be doing wrong would be greatly appreciated.
Here is my code: function Visous_Inertial_Thermal_Dissipation_Model( L,d,Q )
% This program computes the absorption coefficients over a desired range of frequencies of a uniform porous celullar
% solid based on Biot/Zwikker-Kosten single porosity model. Where L is the
% thickness of the sample, a is the pore size, d is the size of the air gap
% behind the sample and Q is the porosity.
alpha=[];
a=0.0001;
while a<=5;
for f=1:100:2000;
u=1.9e-05;
x=(8*u)/a^2;
G=1.4;
Pr=.702;
Po=101320;
qo=1.2;
Ua=((4*pi*qo*f)/(x))^(1/2);
za=(1+i)*Ua;
Ja=besselj(1,za);
Fa=(2*Ja)/((1+i)*Ua*Ja);
pw=(qo/Q)/(1-Fa);
Ub=(Pr*Ua);
zb=(1+i)*Ub;
Jb=besselj(0,zb);
Fb=(2*Jb)/((1+i)*Ub*Jb);
kw=(G*Po/Q)/(1+(G-1)*Fb);
Zw=(pw*kw)^(1/2);
mw=i*2*pi*f*(pw/kw)^(1/2);
co=343;
Zr=-(qo*co)*i*cot((2*pi*f*d)/(co));
Zs=Zw*((Zr*cosh(mw*L)+Zw*sinh(mw*L))/(Zr*sinh(mw*L)+Zw*cosh(mw*L)));
Zo=qo*co;
alpha=[alpha,1-abs((Zs-Zo)/(Zs+Zo))^(2)];
end
a=a+0.25;
end
alpha
I'm trying to make (alpha) a [1x400] matrix, but after the for loop goes through one iteration and the while loop sends it back to the begining of the for loop with a new (a) value, the values for (alpha) become NaN.
Any suggestions as to what I might be doing wrong would be greatly appreciated.

Explanation / Answer

% This program computes the absorption coefficients over a desired range of frequencies of a uniform porous celullar

% solid based on Biot/Zwikker-Kosten single porosity model. Where L is the

% thickness of the sample, a is the pore size, d is the size of the air gap

% behind the sample and Q is the porosity.

alpha=[];

a=0.0001;

while a<=5 //removed semicolon

for f=1:100:2000 //removed semicolon

u=1.9e-05;

x=(8*u)/a^2;

G=1.4;

Pr=.702;

Po=101320;

qo=1.2;

Ua=((4*pi*qo*f)/(x))^(1/2);

za=(1+i)*Ua;

Ja=besselj(1,za);

Fa=(2*Ja)/((1+i)*Ua*Ja);

pw=(qo/Q)/(1-Fa);

Ub=(Pr*Ua);

zb=(1+i)*Ub;

Jb=besselj(0,zb);

Fb=(2*Jb)/((1+i)*Ub*Jb);

kw=(G*Po/Q)/(1+(G-1)*Fb);

Zw=(pw*kw)^(1/2);

mw=i*2*pi*f*(pw/kw)^(1/2);

co=343;

Zr=-(qo*co)*i*cot((2*pi*f*d)/(co));

Zs=Zw*((Zr*cosh(mw*L)+Zw*sinh(mw*L))/(Zr*sinh(mw*L)+Zw*cosh(mw*L)));

Zo=qo*co;

alpha=[alpha,1-abs((Zs-Zo)/(Zs+Zo))^(2)]

end

a=a+0.25;

end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote