Is my angular-reflector antenna code right?
Show older comments
Hello, I've had to make a simulation of an angular-reflector antenna in Matlab. For some reason my code doesn't work propperly. Can someone check is everything correct?


The charts for equations (6.13) and (6.14): <URL=http://imageshack.us/photo/my-images/339/wykresy0002.jpg/>
[code] p = input('insert d/lambda parameter from the interval 0.4 - 0.7: '); l = 'lambda'; d1 = p.*l; %beta factor beta=(2*pi)./l; %fi and theta vectors fi=[-pi:0.01:pi]; theta=[-pi:0.01:pi];
%amplitude charts on elevation surface
felev1 = 2.*(cos(beta.*d1.*sin(theta))-cos(beta.*d1.*cos(theta)));
%the maximum value of function
felev0 = 2.*(cos(beta.*d1.*sin(0))-cos(beta.*d1.*cos(0)));
%h = abs(felev1);
%g = abs(felev0);
fe = abs(felev1./felev0);
polar(theta,fe)
%felev1=abs (2*(cos(beta*d2*sin(theta))-cos(beta*d2*cos(theta)))));
%horizontal amplitude charts
fhor1 = 2.*(cos(beta.*d1.*cos(fi))-1).*(cos((pi./2).*sin(fi)))./cos(fi);
fhor0 = 2.*(cos(beta.*d1.*cos(0))-1).*(cos((pi./2).*sin(0)))./cos(0);
i = fhor1./fhor0;
j = abs(i);
figure
polar(fi,j)
%electric field resolution(I don't know is this term technically correct in English)
[theta,fi] = meshgrid(-pi:0.1:pi,-pi:0.1:pi);
froz1 = 2.*(cos(beta.*d1.*cos(fi).*cos(theta))-cos(beta.*d1.*cos(theta)));
figure
mesh(theta,fi,froz1)
Absolute values are calculated to normalize the charts(max. value of function=1). Chart of 6.13 equation looks like four-times reflected the proper one. And for 6.14 I have a mirror refection of that one I've posted the image. When the fi and theta angles are in intervals: -pi/4:pi/4 and pi/2:pi/2 the characteristics are correct, but it has to work in interval from -pi to pi. Please help, because I don't know how to manage this problem.
1 Comment
Youssef Khmou
on 31 Jan 2013
hi, why did you take l='lambda' ? , do you have theoretical description of this antenna, send it to me. Look at the answer below for the corrected code .
Answers (3)
Youssef Khmou
on 31 Jan 2013
p = input('insert d/lambda parameter from the interval 0.4 - 0.7: ');
l = 'lambda';
d1 = p.*l;
%beta factor
beta=(2*pi)./l;
%fi and theta vectors
fi=[-pi:0.01:pi]; %theta=[-pi:0.01:pi];
theta=fi;
%amplitude charts on elevation surface
felev1 = 2.*(cos(beta*d1'.*sin(theta))-cos(beta*d1'.*cos(theta)));
%the maximum value of function
felev0 = 2.*(cos(beta*d1'.*sin(0))-cos(beta*d1'.*cos(0)));
%h = abs(felev1);
%g = abs(felev0);
fe = abs(felev1./felev0);
polar(theta,fe)
%felev1=abs (2*(cos(beta*d2*sin(theta))-cos(beta*d2*cos(theta)))));
%horizontal amplitude charts
fhor1 = 2.*(cos(beta*d1'.*cos(fi))-1).*(cos((pi./2).*sin(fi)))./cos(fi);
fhor0 = 2.*(cos(beta*d1'.*cos(0))-1).*(cos((pi./2).*sin(0)))./cos(0);
i = fhor1./fhor0;
j = abs(i);
figure
polar(fi,j)
%electric field resolution(I don't know is this term technically correct in English)
[theta,fi] = meshgrid(-pi:0.1:pi,-pi:0.1:pi);
froz1 = 2.*(cos(beta*d1'.*cos(fi).*cos(theta))-cos(beta*d1'.*cos(theta)));
figure
mesh(theta,fi,froz1)
Wieslavv
on 31 Jan 2013
0 votes
Wieslavv
on 31 Jan 2013
0 votes
Categories
Find more on Electromagnetism in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!