Project 2 - Patch Antenna Far-Field Pattern Calculation in MATLAB (May 2015)
Project 2 - Patch Antenna Far-Field Pattern Calculation in MATLAB (May 2015)
Project 2 - Patch Antenna Far-Field Pattern Calculation in MATLAB (May 2015)
TITLE:
NAMES:
DATE DUE:
DATE RECEIVED:
Introduction
The microstrip patch antenna can be considered as a dielectric-loaded cavity for analysis
purposes. The fields within the dielectric substrate can be found by treating the cavity walls as
perfect electric conductors on top and bottom and magnetic walls on all sides. Applying the
surface equivalence principle results in two radiating surface magnetic currents on two sides of
the cavity. Treating the radiating slots as a two-element array of slot antennas yields a
reasonable approximation for the patch antenna pattern.
MATLAB Calculation
After completing the derivation for the far field pattern of the radiating surface
currents, the final formulas were input into MATLAB (see Appendix for full code). The patch
antenna parameters used in the calculations are listed in Table 1. The code inputs and far-field
pattern calculations are depicted in Fig. 1 and Fig. 2 respectively.
Figure 2: Calculating the far-field electric field pattern using patch dimensions
Pattern (dB)
-20
-30
-40
-50
E-plane ( = 90)
H-plane ( = 0)
-60
-70
-80
-80
-60
-40
-20
(deg)
20
40
60
80
Next the patch antenna model is created in HFSS to determine the simulated E-plane
and H-plane far-field patterns. The same dimensions from the MATLAB calculation are
incorporated in the patch model, as depicted in Fig. 4.
Pattern (dB)
-5
-10
E-plane ( = 90)
H-plane ( = 0)
-15
-60
-80
-40
-20
(deg)
20
40
80
60
-2
-10
Pattern (dB)
Pattern (dB)
-20
-4
-6
-8
-60
-40
-20
(deg)
20
40
-50
-70
-12
-80
-40
-60
-10
-30
60
-80
80
-80
-60
-40
-20
(deg)
20
40
60
80
Conclusion
The calculated E-plane pattern from MATLAB shows strong agreement with the pattern
from HFSS simulations. However, the calculated H-plane pattern has sharp nulls at = 80 and
at = -80. The HFSS simulated H-plane pattern is very smooth in comparison to the calculated
pattern.
% [Balanis 12-12]
% [Balanis 12-12]
%**************************************************************************
%
polar_dB(theta,rho,rmin,rmax,rticks,line_style)
%**************************************************************************
%
POLAR_DB is a MATLAB function that plots 2-D patterns in
%
polar coordinates where:
%
0
<= THETA (in degrees) <= 360
%
-infinity < RHO
(in dB)
< +infinity
%
%
Input Parameters Description
%
---------------------------%
- theta (in degrees) must be a row vector from 0 to 360 degrees
%
- rho (in dB) must be a row vector
%
- rmin (in dB) sets the minimum limit of the plot (e.g., -60 dB)
%
- rmax (in dB) sets the maximum limit of the plot (e.g.,
0 dB)
%
- rticks is the # of radial ticks (or circles) desired. (e.g., 4)
%
- linestyle is solid (e.g., '-') or dashed (e.g., '--')
%
%
Credits:
%
S. Bellofiore
%
S. Georgakopoulos
%
A. C. Polycarpou
%
C. Wangsvick
%
C. Bishop
%
%
Tabulate your data accordingly, and call polar_dB to provide the
%
2-D polar plot
%
%
Note: This function is different from the polar.m (provided by
%
MATLAB) because RHO is given in dB, and it can be negative
%---------------------------------------------------------------------------function hpol = polar_dB(theta,rho,rmin,rmax,rticks,line_style)
% Convert degrees into radians
theta = theta * pi/180;
% Font size,
font_size =
font_name =
line_width =
if nargin < 5
error('Requires 5 or 6 input arguments.')
elseif nargin == 5
if isstr(rho)
line_style = rho;
rho = theta;
[mr,nr] = size(rho);
if mr == 1
theta = 1:nr;
else
th = (1:mr)';
theta = th(:,ones(1,nr));
end
else
line_style = 'auto';
end
elseif nargin == 1
line_style = 'auto';
rho = theta;
[mr,nr] = size(rho);
if mr == 1
theta = 1:nr;
else
th = (1:mr)';
theta = th(:,ones(1,nr));
end
end
if isstr(theta) | isstr(rho)
error('Input arguments must be numeric.');
end
if any(size(theta) ~= size(rho))
error('THETA and RHO must be the same size.');
end
% get hold state
cax = newplot;
next = lower(get(cax,'NextPlot'));
hold_state = ishold;
% get x-axis text color so grid is in same color
tc = get(cax,'xcolor');
% Hold on to current Text defaults, reset them to the
% Axes' font attributes so tick marks use them.
fAngle = get(cax, 'DefaultTextFontAngle');
fName
= get(cax, 'DefaultTextFontName');
fSize
= get(cax, 'DefaultTextFontSize');
fWeight = get(cax, 'DefaultTextFontWeight');
set(cax, 'DefaultTextFontAngle', get(cax, 'FontAngle'), ...
'DefaultTextFontName',
font_name, ...
'DefaultTextFontSize',
font_size, ...
'DefaultTextFontWeight', get(cax, 'FontWeight') )
% only do grids if hold is off
if ~hold_state
% make a radial grid
hold on;
% v returns the axis limits
% changed the following line to let the y limits become negative
hhh=plot([0 max(theta(:))],[min(rho(:)) max(rho(:))]);
v = [get(cax,'xlim') get(cax,'ylim')];
ticks = length(get(cax,'ytick'));
delete(hhh);
% check radial limits (rticks)
if rticks > 5
% see if we can reduce the number
if rem(rticks,2) == 0
rticks = rticks/2;
elseif rem(rticks,3) == 0
rticks = rticks/3;
end
end
% define a circle
th = 0:pi/50:2*pi;
xunit = cos(th);
yunit = sin(th);
% now really force points on x/y axes to lie on them exactly
inds = [1:(length(th)-1)/4:length(th)];
xunits(inds(2:2:4)) = zeros(2,1);
yunits(inds(1:2:5)) = zeros(3,1);
rinc = (rmax-rmin)/rticks;
% label r
% change the following line so that the unit circle is not multiplied
% by a negative number. Ditto for the text locations.
for i=(rmin+rinc):rinc:rmax
is = i - rmin;
plot(xunit*is,yunit*is,'-','color',tc,'linewidth',0.5);
text(0,is+rinc/20,[' ' num2str(i)],'verticalalignment','bottom' );
end
% plot spokes
th = (1:6)*2*pi/12;
cst = cos(th); snt = sin(th);
cs = [-cst; cst];
sn = [-snt; snt];
plot((rmax-rmin)*cs,(rmax-rmin)*sn,'-','color',tc,'linewidth',0.5);
% plot the ticks
george=(rmax-rmin)/30; % Length of the ticks
th2 = (0:36)*2*pi/72;
cst2 = cos(th2); snt2 = sin(th2);
cs2 = [(rmax-rmin-george)*cst2; (rmax-rmin)*cst2];
sn2 = [(rmax-rmin-george)*snt2; (rmax-rmin)*snt2];
plot(cs2,sn2,'-','color',tc,'linewidth',0.15); % 0.5
plot(-cs2,-sn2,'-','color',tc,'linewidth',0.15); % 0.5
10
end
% set viewto 2-D
view(0,90);
% set axis limits
% Changed the next line to scale things properly
axis((rmax-rmin)*[-1 1 -1.1 1.1]);
end
% Reset defaults.
set(cax, 'DefaultTextFontAngle', fAngle , ...
'DefaultTextFontName',
font_name, ...
'DefaultTextFontSize',
fSize, ...
'DefaultTextFontWeight', fWeight );
% transform data to Cartesian coordinates.
% changed the next line so negative rho are not plotted on the other side
for i = 1:length(rho)
if (rho(i) > rmin)
if theta(i)*180/pi >=0 & theta(i)*180/pi <=90
xx(i) = (rho(i)-rmin)*cos(pi/2-theta(i));
yy(i) = (rho(i)-rmin)*sin(pi/2-theta(i));
elseif theta(i)*180/pi >=90
xx(i) = (rho(i)-rmin)*cos(-theta(i)+pi/2);
yy(i) = (rho(i)-rmin)*sin(-theta(i)+pi/2);
elseif theta(i)*180/pi < 0
xx(i) = (rho(i)-rmin)*cos(abs(theta(i))+pi/2);
yy(i) = (rho(i)-rmin)*sin(abs(theta(i))+pi/2);
end
else
xx(i) = 0;
yy(i) = 0;
end
end
% plot data on top of grid
if strcmp(line_style,'auto')
q = plot(xx,yy);
else
q = plot(xx,yy,line_style);
end
if nargout > 0
hpol = q;
end
if ~hold_state
axis('equal');axis('off');
end
% reset hold state
if ~hold_state, set(cax,'NextPlot',next); end
11