In: Electrical Engineering
BY Using MATLAB software:
Exercise 3: Calculation of the parameters of a dipole.
% M-File: ML0804
%
% Perform numerical integration to find
% beam solid angle, directivity, and the
% maximum power function for a given length
% dipole.
%
% Variables
% L dipole length (in wavelengths)
% bL2 phase constant * length/2
% N number of theta points
% th,thr angle theta in degrees,radians
% dth differential theta
% num,den temporary variables
% F un-normalized power function
% Fmax maximum power function (W/m^2)
% omegaP beam solid angle (sr)
% D Directivity
clc %clears the command window
clear %clears variables
% Initialize variables
L=1.5;
bL2=pi*L;
N=90;
% Perform calculations
i=1:1:N;
dth=pi/N;
th(i)=i*pi/N;
num(i)=cos(bL2.*cos(th(i)))-cos(bL2);
den(i)=sin(th(i));
F(i)=((num(i)).^2)./den(i);
Fmax=max(F);
Pn=F./Fmax;
omegaP=2*pi*dth*sum(Pn)
D=4*pi/omegaP
Fmax
Question 3: Run this program for different choices of the dipole length.
Re-write the MATLAB code by entering the input dipole length:
% M-File: ML0804
%
% Perform numerical integration to find
% beam solid angle, directivity, and the
% maximum power function for a given length
% dipole.
%
% Variables
% L dipole length (in wavelengths)
% bL2 phase constant * length/2
% N number of theta points
% th,thr angle theta in degrees,radians
% dth differential theta
% num,den temporary variables
% F un-normalized power function
% Fmax maximum power function (W/m^2)
% omegaP beam solid angle (sr)
% D Directivity
clc %clears the command window
clear %clears variables
% Initialize variables
L=input('Enter the value of L=')
bL2=pi*L;
N=90;
% Perform calculations
i=1:1:N;
dth=pi/N;
th(i)=i*pi/N;
num(i)=cos(bL2.*cos(th(i)))-cos(bL2);
den(i)=sin(th(i));
F(i)=((num(i)).^2)./den(i);
Fmax=max(F);
Pn=F./Fmax;
omegaP=2*pi*dth*sum(Pn)
D=4*pi/omegaP
Fmax