SCHIERE DI ANTENNE FILIFORMI ENDFIRE Listato del programma endfire.m
% disegno del grafico del
fattore di schiera F e del corrispondente % fattore di irradiazione
totale ftot % delle schiere di
antenne filiformi endfire clear
all close
all lm=1; N=3; d=((N-1)/N)*(lm/2); kod=(2*pi/lm)*d; u=-kod:0.01:kod-0.01; u1=-2*pi:0.01:2*pi; y=abs(sin((N/2)*(u-kod))./sin((1/2)*(u-kod))); y1=abs(sin((N/2)*(u1-kod))./sin((1/2)*(u1-kod))); plot(u1,y1,'r',u,y,'k') title('grafico
di F=abs(sin((N/2)*(u-ko*d))/sin((1/2)*(u-ko*d)))') xlabel('u') zoom grid clear
y x=0.01:0.01:2*pi; y=abs(sin((N/2)*kod*(cos(x)-1))./sin((1/2)*kod*(cos(x)-1))); figure plot(x,y) title('grafico
di F=sin((N/2)*k0*d*(cos(\Psi)-1))/sin((1/2)*k0*d*(cos(\Psi)-1))'); xlabel('\Psi') zoom grid clear
x y TH=0.01:0.01:2*pi-0.01; for i=1:length(TH)
if cos(TH(i))~=1
R(i)=abs(sin((N/2)*kod*(cos(TH(i))-1))/sin((1/2)*kod*(cos(TH(i))-1)));
end end figure polar(TH,R); title('grafico:
sin((N/2)*ko*d*(cos(\Psi)-1))/sin((1/2)*ko*d*(cos(\Psi)-1))') xlabel('\Psi') clear R phi=0:.1:2*pi; %
è il TH del MATLAB th=0:.1:pi;
% è pi/2-PHI del MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
R=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1))*(cos((pi/2)*cos(th(i)))/sin(th(i))));
[x(h),y(h),z(h)]=sph2cart(phi(j),pi/2-th(i),R);
end end end figure no=gcf; plot(x,y,'r') grid figure plot(y,z,'r') grid figure plot(x,z,'r') grid h=0; for i=1:length(th)
for j=1:length(phi)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
R=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1))*(cos((pi/2)*cos(th(i)))/sin(th(i))));
[x1(h),y1(h),z1(h)]=sph2cart(phi(j),pi/2-th(i),R);
end end end figure noo=gcf; plot(x1,y1,'r') grid figure plot(y1,z1,'r') grid figure plot(x1,z1,'r') grid x=[x,x1]; y=[y,y1]; z=[z,z1]; clear
R phi th phi=0:.1:2*pi; %
è il TH del MATLAB th=0:.1:pi;
% è pi/2-PHI del MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
Rd=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1)));
[xd(h),yd(h),zd(h)]=sph2cart(phi(j),pi/2-th(i),Rd);
end end end figure(no) hold
on plot(xd,yd) hold
off xlabel('x') ylabel('y') title('curve
di livello verticali: F,ftot (in rosso)'); grid figure(no+1) hold
on plot(yd,zd) hold
off xlabel('y') ylabel('z') title('curve
di livello verticali: F,ftot (in rosso)'); grid figure(no+2) hold
on plot(xd,zd) hold
off xlabel('x') ylabel('z') title('curve
di livello verticali: F,ftot (in rosso)'); grid h=0; for i=1:length(th)
for j=1:length(phi)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
Rd=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1)));
[xd1(h),yd1(h),zd1(h)]=sph2cart(phi(j),pi/2-th(i),Rd);
end end end figure(noo) hold
on plot(xd1,yd1) hold
off xlabel('x') ylabel('y') grid title('curve
di livello orizzontali: F,ftot (in rosso)'); figure(noo+1) hold
on plot(yd1,zd1) hold
off xlabel('y') ylabel('z') grid title('curve
di livello orizzontali: F,ftot (in rosso)'); figure(noo+2) hold
on plot(xd1,zd1) hold
off xlabel('x') ylabel('z') grid title('curve
di livello orizzontali: F,ftot (in rosso)'); xd=[xd,xd1]; yd=[yd,yd1]; zd=[zd,zd1]; clear
Rd phi th phi=-0.01:0.01:2*pi; %
è il TH del MATLAB th=pi/2;
% è pi/2-PHI del MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
RR=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1)));
[xx(h),yy(h),zz(h)]=sph2cart(phi(j),pi/2-th(i),RR);
end end end clear
phi th phi=0;
% è il TH del MATLAB th=-0.01:0.01:2*pi; % è pi/2-PHI del
MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 %&
cos(phi(j))~=1
h=h+1;
RRR=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1)));
[xxx(h),yyy(h),zzz(h)]=sph2cart(phi(j),pi/2-th(i),RRR);
end
end end clear
R phi th phi=pi/2; %
è il TH del MATLAB th=0:0.01:2*pi;
% è pi/2-PHI del MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
RRRR=(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1)));
[xxxx(h),yyyy(h),zzzz(h)]=sph2cart(phi(j),pi/2-th(i),RRRR);
end end end clear
R figure n1=gcf; plot(xx,yy) xlabel('x') ylabel('y') axis
equal grid figure plot(yyyy,zzzz') xlabel('y') ylabel('z') axis
equal grid figure plot(xxx,zzz) xlabel('x') ylabel('z') axis
equal grid % % % figure plot3(xd,yd,zd) grid xlabel('x') ylabel('y') zlabel('z') title('F'); figure plot3(x,y,z) grid xlabel('x') ylabel('y') zlabel('z') title('ftot'); figure plot3(xd,yd,zd,x,y,z,'r') grid xlabel('x') ylabel('y') zlabel('z') title('F,ftot(in
rosso)'); clear
RR RRR RRRR xx xxx xxxx yy yyy yyyy zz zzz zzzz phi th phi=-0.01:0.01:2*pi; %
è il TH del MATLAB th=pi/2;
% è pi/2-PHI del MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
RR=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1))*(cos((pi/2)*cos(th(i)))/sin(th(i))));
[xx(h),yy(h),zz(h)]=sph2cart(phi(j),pi/2-th(i),RR);
end
end end clear
phi th phi=0;
% è il TH del MATLAB th=-0.01:0.01:2*pi; % è pi/2-PHI del
MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0
h=h+1;
RRR=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1))*(cos((pi/2)*cos(th(i)))/sin(th(i))));
[xxx(h),yyy(h),zzz(h)]=sph2cart(phi(j),pi/2-th(i),RRR);
end end end clear
phi th phi=pi/2; %
è il TH del MATLAB th=-0.01:0.01:2*pi; % è pi/2-PHI del
MATLAB h=0; for j=1:length(phi)
for i=1:length(th)
if sin(th(i))~=0 & cos(phi(j))~=1
h=h+1;
RRRR=abs(sin((N/2)*kod*(sin(th(i))*cos(phi(j))-1))/sin((1/2)*kod*...
(sin(th(i))*cos(phi(j))-1))*(cos((pi/2)*cos(th(i)))/sin(th(i))));
[xxxx(h),yyyy(h),zzzz(h)]=sph2cart(phi(j),pi/2-th(i),RRRR);
end end end clear
R figure(n1) hold
on plot(xx,yy,'.r') hold
off xlabel('x') ylabel('y') title('F,ftot
(in rosso)'); axis
equal grid figure(n1+1) hold
on plot(yyyy,zzzz,'r') xlabel('y') ylabel('z') title('F,ftot
(in rosso)'); axis
equal grid hold
off figure(n1+2) hold
on plot(xxx,zzz,'r') xlabel('x') ylabel('z') title('F,ftot
(in rosso)'); axis
equal grid hold off
|