clear all
close all
clc
c1=1500;
c2=1800;
row1=1000;
row2=1200;
f=150;
w=2*pi*f;
h=50;
r=500;
k1=w/c1;
k2=w/c2;
b12=row1/row2;
Q=1;
m=5;
z=20;
zprime=40;
alphac=acos(c1/c2);
if z<h
zl=z;
zg=zprime;
else
zl=zprime;
zg=z;
end
phi=zeros(h,r,m);
EJP=zeros(h,r,m);
Res=zeros(h,r,m);
for im=1:1:m
for ix=1:1:r
for iy=1:1:h
he=h*(1+1/(b12*k1*h*sin(alphac)));
n1=(im*pi)/he;
n2=i*k1*sin(alphac)*(1-(im^2*pi^2)/(h^2*he^2*sin(alphac)))^0.5;
p=-k1*(1-(im^2*pi^2)/(k1^2*he^2))^0.5;
D=n1*cos(n1*h)+i*b12*n2*sin(n1*h);
F1=(sin(n1*zl)/n1)*(n1*cos(n1*(h-zg))+i*b12*n2*sin(n1*(h-zg)))/D;
F2=(sin(n1*zl)*exp(-i*n2*(zg-h)))/D;
if h<=h
Res(iy,ix,im)=(n1*sin(n1*z)*sin(n1*zprime))/...
(p*(n1*h-sin(n1*h)*cos(n1*h)-b12^2*sin(n1*h)*tan(n1*h)))*exp(i*p*ix);
f=n2/(k2^2-n2^2)^0.5*F1*exp(-i*(k2^2-n2^2)^0.5*ix);
EJP(iy,ix,im)=integral(@(n2)f,n2,-inf,inf);
else
Res(iy,ix,im)=b12*(n1*sin(n1*h)*sin(n1*zprime)*exp(-i*n2(z-h)))/...
(p(n1*h-sin(n1*h)*cos(n1*h)-b12^2*sin(n1*h)*tan(n1*h)))*exp(i*p*ix);
f=n2/(k2^2-n2^2)^0.5*F2*exp(-i*(k2^2-n2^2)^0.5*ix);
EJP(iy,ix,im)=b12*integral(@(n2)f,n2,-inf,inf);
end
phi(iy,ix,im)=(Q/(2*pi*ix^0.5))*(2*pi*i*Res(iy,ix,im)+EJP(iy,ix,im));
end
end
end
phi=sum(phi,3);
pcolor(h,x,abs(psi));
Best Answer