Hello,
:
I need help to solve one problem and I'm stucked in a part, I have to design a linear array of N dipoles having a maximum of the radiation pattern in a direction given by: theta = pi/2 phi = pi/4 + 9*pi/56.
I have got this, and I have adapted to my case, but I don't know where I have to change the data tu include de direction given :
clearclose allN=4; %number of antennas
lambda=10; %length of the antennas (m)
%positions of dipoles
X= [-lambda/2 -lambda/4 lambda/4 lambda/2] Y= zeros(1,N); Z= zeros(1,N); %amplitudes of dipoles
A=ones(1,N); ang = [pi/2 0 0 pi/2] %0:pi/4:(N-1)*pi/4; %rad
E1=A.*exp(j*ang); %field constant
%go spheric
[a1,a2,delta]=cart2sph(X,Y,Z);phip=a1;thetap=pi/2-a2;RP=10; %distance at which the field is measured (m)
Rez=100; %resolution of represetation
phi=linspace(0,2*pi, 2*Rez);theta=linspace(0,pi,Rez);E=zeros(length(theta),length(phi));AE=zeros(length(theta),length(phi));XE=zeros(length(theta),length(phi));YE=zeros(length(theta),length(phi));ZE=zeros(length(theta),length(phi));for u1=1:length(theta), for v1=1:length(phi), u=theta(u1); v=phi(v1); cosA=sin(u)*sin(thetap).*cos(v-phip)+cos(u)*cos(thetap); E2=E1/RP*exp(-j*2*pi*RP/lambda).*exp(j*2*pi/lambda*delta.*cosA)*sin(u); E3=sum(E2); E(u1,v1)=E3; AE(u1,v1)=abs(E(u1,v1)); XE(u1,v1)=abs(E(u1,v1))*sin(u)*cos(v); YE(u1,v1)=abs(E(u1,v1))*sin(u)*sin(v); ZE(u1,v1)=abs(E(u1,v1))*cos(u); endendX=XE/max(max(AE));Y=YE/max(max(AE));Z=ZE/max(max(AE));figure (1)%colormap('gray')
surf(X,Y,Z)%axis equal
axis squarexlabel('x')ylabel('y')zlabel('z')
Thanks for all,
Francisco
Best Answer