import math
#We know that E=cos(theta)*cos(pi*cos(theta)/4)
#To find the nulls we equate the above equation with 0 at null angle
theta_b0=math.acos(0)
print "Nulls for beta equal to 0: %d deg" %(math.degrees(theta_b0))
theta_b_pi_2_p=math.acos(0)
print "Nulls for beta equal to +pi/2: %d deg" %(math.degrees(theta_b_pi_2_p))
theta_b_pi_2_n=math.acos(0)
theta_b_pi_2_n2=math.acos(1+(4/pi)*(-pi/2))
print "Nulls for beta equal to -pi/2: %d deg %d deg" %(math.degrees(theta_b_pi_2_n),math.degrees(theta_b_pi_2_n2))
import math
import numpy as np
#To find the nulls we have to equate E=cos(theta)*cos(0.5*(k*d*cos(theta)+beta))
theta_n=math.acos(0)
print "Nulls occur at : %d deg" %math.degrees(theta_n)
#lamda=50.0
#d=lamda/2
#beta=pi/2
#theta_n1=np.zeros(11)
#n=np.linspace(0,10,11,'int')
#for i in range(0,11):
# theta_n1[i]=math.acos((lamda/(2*pi*d))*(-beta+(2*int(n[i])+1)*pi))"""
#Let us assume lambda = 50
lamda=50
N=10
d=lamda/4
D0=(2*N)*(float(d)/lamda)
D0_dB=10*log10(D0)
print "Directivity of the array antenna:",D0_dB,"dB"
#assume lamda = 50
lamda=50
d=float(lamda)/4
N=10
D0=(4*N)*(d/lamda)
D0_dB=10*log10(D0)
print "Directivity of antenna:",D0_dB,"dB"
#assume lamda = 50
lamda=50
d=float(lamda)/4
D0=1.805*(4*N)*(d/lamda)
D0_dB=10*log10(D0)
print "Directivity of Hansen-Woodyard antenna:",D0_dB,"dB"
import scipy
#assume lamda=50
lamda=50.0
#Given data
theta=30
theta0=theta*pi/180
d=lamda/4
k=(2*pi)/lamda
beta=-k*d*cos(theta0)
print "Progressive phase:",beta,"radians"
#Given N=10
N=10
#function to calculate HPBW
def hp(N):
return 1.06/(sqrt(N-1))
HPBW=hp(N)
print "Half-power Beamwidth:",HPBW,"radians, ",HPBW*180/pi,"degrees"
#directivity given by formula d0=((2N-2)(2N-4)...2)/((2N-3)(2N-5)...1) here N=10
#Function to calculate the directivity
def d0(N):
nume=numer(N)
deno=denom(N)
return float(nume)/deno
#Function to calculate the numerator of the above formula
def numer(N):
temp=1
i=2
while(2*N-i)>1:
temp=temp*(2*N-i)
i=i+2
return temp
#Function to calculate denominator of the above formula
def denom(N):
temp=1
i=3
while(2*N-i)>0:
temp=temp*(2*N-i)
i=i+2
return temp
D01=d0(N)
D0_dB=10*log10(D01)
print "Directivity:",D0_dB,"dB"
D02=1.77*sqrt(N)
print "Directivity using other formula:",10*log10(D02),"dB"
import scipy
import math
#Given R0=26db
R0_dB=26.0
R0=pow(10,(R0_dB/20))
R0=int(math.ceil(R0))
#broadening factor f
f=1+(0.636)*((2.0/R0)*cosh(sqrt(math.acosh(R0)**2-pi**2)))**2
print "Broadening factor:",f
#theta_h from the graph
theta_h=10.17
beamwidth=theta_h*f
print "Beamwidth:",beamwidth,"deg."
#Assume lamda = 50
lamda=50
L_plus_d=5*lamda
D0=(2*R0**2)/(1+(R0**2-1)*f*(float(lamda)/L_plus_d))
print "Directivity:",D0,",",10*log10(D0),"dB"
import math
#Function to calculate sec(x)
def sec(t):
return sqrt(1+tan(t)**2)
x=pi/180 #Factor to convert degrees to radians, in-built function is also present
#this example relies on data of Example 6.10
lamda=50
L_plus_d=5*lamda
theta_x0=theta_y0=10.97 #from example 6.10
theta_0=30 #Given
theta_h=theta_x0*sec(theta_0*x)
psi_h=theta_x0
omega_a=theta_h*psi_h
print "Solid angle:",omega_a,"deg_square"
D0x=D0y=9.18 #from ex 6.10
#Directivity of the array
D0=pi*cos(theta_0*x)*D0x*D0x
print "Directivity:",D0,", in dB:",10*log10(D0),"dB"
D01=32400.0/(omega_a)
print "Directivity using 6-101:",D01,", in dB:",10*log10(D01),"dB"