import scipy
import math
#For a given D0 of 8dB optimum sigma is 0.157
sigma=0.157
tau=0.865
alpha=math.degrees(math.atan((1-tau)/(4*sigma)))
print "Angle between edges:",alpha
B_ar=1.1+7.7*(1-tau)**2*(1/math.tan(math.radians(alpha)))
print "Active Region Bandwidth:",B_ar
f_max=(216000000.0)
f_min=(54000000.0)
B=f_max/f_min
B_s=B*B_ar
print "Designed Bandwidth:",B_s
v=300000000
lamda_max=v/f_min
print "Maximum wavelength:",lamda_max,"m"
L=(lamda_max/4)*(1-1/B_s)*(math.cos(math.radians(alpha)))/(math.sin(math.radians(alpha)))
print "Total length of structure:",L,"m"
N=1+(log(B_s)/(log(1/tau)))
print "Number of elements:",int(N)
sigma_1=sigma/sqrt(tau)
print "Relative mean spacing:",sigma_1
def toFeet(m):
return m*3.2804
l_max=toFeet(lamda_max)/2
ratio=l_max*int(alpha)/0.75
Z_a=120*(log(ratio)-2.25)
print "Average characteristic impedance of elements:",Z_a,"ohms"
R_in=50.0
ratio_2=Z_a/R_in
Z0=1.2*R_in
print "Average characteristic impedance of feeder line:",Z0,"ohms"
s=(3.0/4)*cosh(Z0/120.0)
print "Center-to-center spacing of feeder conductors:",s,"in."