#### hbb2

##### Newbie level 1

I'm trying to plot the far-field radiation pattern of a thin wire dipole antenna using the equation I found on balanis book(antenna theory, 3rd edition, section 4.5.2):

\[E_{\theta} = j{\eta}\frac{ke^{-jkr}}{4{\pi}r}sin({\theta}){\int}_{-l/2}^{l/2}I_{e}(x',y',z')e^{jkz'cos({\theta})dz'}\]

When the current feed 'Ie' is modeled as a sine wave. The antenna is on the z-axis feeded in z = 0 and its length is l (from -l/2 to +l/2).

I calculated this on matlab for a phased linear array (5 elements) and plotted the power pattern but the result I get is different from 4nec simulation. I should see side lobes appear when phasing the input sinusoidal current, but I get only one main lobe for every element. Here is my matlab code:

signalgen:

Code:

```
function x = signalgen
c = 3*(10^8);
f = 3*10^8;
lambda = c / f;
k = 2 * pi / lambda;
er = 1;
epsilon0 = 8.854187*(10^(-12));
epsilon = er * epsilon0;
mu0 = 4 * pi * 10^(-7);
etha = sqrt(mu0/epsilon);
% antenna length
l = 2;
amp = 1;
% Number of elements on the array
m = 5;
% Spacing between elements:
d = 0.1;
etheta = zeros(m,360);
wav = zeros(m,360);
for i = 1:m
for theta = 1:360
% Distance
r = 100;
% Eq. (4-58a), Antenna Theory - Balanis
integrand = @(zl)(ie(amp, k, l, zl, 2*pi*d*(i-1)*sin(pi/4)/lambda) * exp(1i * k * zl * cos(2*pi*theta/360)));
etheta(i,theta) = 1i * etha * ((k * exp(- 1i * k * r))/(4 * pi * r)) * sin(2*pi*theta/360) * ...
integral(integrand,(-l/2),(+l/2), 'ArrayValued', true);
end
% Poynting vector:
wav(i,:) = etheta(i,:).*conj(etheta(i,:))/etha;
h = polar((2*pi)/360:2*pi/360:2*pi,(wav(i,:)));
set(h, 'Color', [1/(i^1.5) 1/i 1/(m+1-i)]);
hold all
end
end
```

sine current:

Code:

```
function i = ie(amp, k, l, z, phaseshift)
if ( abs(z) < l/2)
if (z >= 0)
i = amp*sin(k*((l/2) - z) - phaseshift);
else
i = amp*sin(k*((l/2) + z) - phaseshift);
end
else
i = 0;
end
end
```

So what's wrong?

Thank you