In: Electrical Engineering
Design E shape microstrip patch array antenna in ansys for a frequency and write the matlab code for it.
i need this all with matlab code.if you are able to do then try or else leave it for other.ONLY WANT MATLAB CODE
clc
clear all
close all
% % d=1.5e-3;
yo=3.126e-3; %feed position from an edge of patch
% w=11.86e-3; %width of the patch
% l=9.06e-3; %length of the patch
c=3e8; %speed in a space
er=2.2; %permitivity of substrate
fr=10e+9; %solution freq
lambda=c/fr; %wavelength in free space
% cf=1e-9; %fringing capacitance
%
ko=2.0.*pi/lambda;
%
eo=8.85418782e-12; %free space permitivity
h=1.588e-3; %substrate thickness
% Pn=10e-3; %dis bet. feed and middle of slot
%
% ln=40e-3; %length of the slot
% s=6e-3; %width of the slot
Zo=50;
f=1*10^9:1*10^9:15*10^9;
% d=1.29e-3;
% c4=1.26e-12;
% xx=lambda/4;
w=(c/(2*fr))*sqrt((2/(er+1)));
% Effective dielectric and effective length calculation
ef= (er+1)./2 + ((er-1)./2)*(1./sqrt(1+(12.*h./w)));
lef=c./(2.*fr.*sqrt(ef));
delL=0.412.*h.*((ef+0.3)./(ef-0.258)).*(((w./h)+0.264)./((w./h)+0.8));
l=lef-2*delL;
% F=(acos(pi.*yo./l))^2;
% C=((er.*eo.*lef.*w)./2.*h).*F;
% L=(((2.*pi.*fr).^2).^-1)./C;
%
F=(acos(pi*yo/l))^2;
C=ef*eo*lef*w*F/(2*h);
L=1/((2*pi*fr)^2*C);
%The resonance resistances of the two resonators
th=0:1:180; t=th.*pi./180;
ARG=cos(t).*(ko.*w./2);
res1=sum(sinc(ARG./pi).^2.*sin(t).^2.*sin(t).*((pi./180)*(ko.*w./2).^2));
res12=sum(sinc(ARG./pi).^2.*sin(t).^2.*besselj(0,sin(t).*(ko.*l)).*sin(t).*((pi./180)*(ko.*w./2).^2));
G1=res1./(120.*pi.^2); G12=res12./(120.*pi.^2);
Rin0P=(2.*(G1+G12)).^-1;
Rin=Rin0P.*cos(pi.*yo./l).^2;
% Input Impedance calculation calculation
W=2*pi*f;
z1=1i*W*L*Rin./(Rin-W.^2*L*C*Rin+1i*W*L);
Lp=60*(h/c)*log(c/(0.2886*fr*pi));
zp=1i*W*Lp;
zin=(z1+zp);
% Return loss calculation
ref=(zin-50)./(zin+50);
returnloss=20*log10(abs(ref));
plot(f,returnloss)
title('Return loss characteristics');
xlabel('frequency');
ylabel('Return loss');
grid on
figure
This is done for 2.4 Ghz frequency