syms x y z r ;
s=0:1:300;t=0:0.5:150;R=300;f=1*10^6;w=2*pi*f;v0=w*R;a=3;b=4;;
a=a+s;b=b+t;
x=0:300;
y=0:300;
if (x-a).*(x-a)+(y-b).*(y-b)<R^2
    v=v0
else  v=0
end
p0=1e-6;
c0=1450;
r=c0/f;
c=3;pa=0;pb=0;pn=0;pm=0;n=3;m=5;l=0:0.01:c;z=l*r;
for nx=0:1:20;
   for ny=0:1:20;
       s=(nx/n)^2+(ny/m)^2;
       if s<4
          pa=pa+2*c0.*sin(pi.*sqrt(4-s).*(c-z./r))./(sqrt(4-s).*cos(pi.*sqrt(4-s).*c));
          P1=p0*w*v'.*pa;
       else
           if s>4
              pb=pb+2*c0.*sinh(pi.*sqrt(s-4).*(c-z./r))./(sqrt(s-4).*cosh(pi.*sqrt(s-4).*c));
              P2=p0*w*(v)'.*pb;
           end
       end
   end
end
pn=abs(P1);pm=abs(P2);p=abs(P1+P2);