Professional Documents
Culture Documents
Matlab Code
Matlab Code
Matlab Code
% Name: RadPattern3D
%**************************************************************************
%Usage:
clear all
theta=[0:0.12:2*pi];%theta vector
phi=[0:0.12:2*pi];%phi vector
n=120*pi;%eta
% evaluating radiation intensity(U)
%converting to dB scale
U1_1=10*log10(U1);
min1=min(U1_1);
U=U1_1-min1;
U(1,1)=0;
for n=1:length(phi)
theta(n,:)=theta(1,:);
end
phi=phi';
for m=1:length(phi)
phi(:,m)=phi(:,1);
end
for k=1:length(U)
U(k,:)=U(1,:);
end
[x,y,z]=sph2cart(phi,theta,U);
%plotting routine
surf(x,y,z)
colormap(copper)
xlabel('x-axis--->')
ylabel('y-axis--->')
zlabel('z-axis--->')
below code Calculates the length and width and inset of microstrip patch antenna
clc
clear all
format long
% er=2.2;
% f=10e9;
% h=0.1588*10;
f=f*1e9;
h=h*0.0254; % in mm
wid=(3e8/(sqrt((er+1)/2)*2*f))*1000; %in mm
l_eff=(3e8/(2*f*sqrt(e_eff)))*1000;
del_l=(((e_eff+0.3)*((wid/h)+0.264))/((e_eff-0.258)*((wid/h)+0.8)))*(0.412*h); %in mm
L=l_eff-(2*del_l);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
la=(3e8/f)*1000;
k=(2*pi)/la;
x=k*(wid);
i1=-2+cos(x)+(x*sinint(x))+(sin(x)/x);
g1=i1/(120*pi*pi); %Conductance
% jb=besselj(0,(k.*L.*sin(th)));
a=@(th)(((sin((x./2).*cos(th))./cos(th)).^2).*(besselj(0,(k.*L.*sin(th)))).*(sin(th)).^3);
a1=quad(a,0,pi);
inset=(L/pi)*(acos(sqrt(50/r_in))); %in mm