import math
#Assume lamda = 50
lamda=50.0
a=3*lamda
b=2*lamda
n=1
theta_1=114.6*(math.asin(n*lamda/b))
print "First Null Beamwidth:",theta_1,"deg"
theta_h=114.6*math.asin(0.443*lamda/b)
print "Half-power beamwidth:",theta_h,"deg"
theta_s=114.6*math.asin(1.43*lamda/b)
print "First Sidelobe Beamwidth:",theta_s,"deg"
E_s=0.217
print "Maximum of first side lobe:",20*log10(E_s),"dB"
D0=4*pi*a*b/lamda**2
print "Maximum directivity:",10*log10(D0),"dB"
#Given
lamda=50.0
#For a=b=20*lamda
print "For a=b=20*lamda, the efficiency for the uniform aperture is 94%."
a=b=3*lamda
k=2*pi/lamda
theta1=10*pi/180
u=(k*a/2)*sin(theta1)
print "For u = %f, the efficiency is 58."%u
#Given
lamda=50.0
theta=30*pi/180
a_sq=b_sq=lamda/(2*sin(theta))
D0=pi/sin(theta)**2
print "Directivity of square patch is : %f dB" %(10*log10(D0))
a_cir=lamda/(3.413*sin(theta))
D0cir=(1.079*pi)/(sin(theta)**2)
print "Directivity of circular patch is : %f dB" %(10*log10(D0cir))
#Given
Zc=73+42.5j #Characteristic impedance
eta=376.7
Zs=eta**2/(4*Zc)
print "Terminal(input) impedance od the slot:",Zs,"Ohms"