#given data :
f=6.0 #in GHz
f=f*10**9 #in Hz
d=10 #in feet
d=3.048 #in meter
c=3*10**8 #in m/s
lamda=c/f #in meters
rmin=2*d**2/lamda #in meters
print "Minimum separation distance = %0.2f m" %rmin
#given data :
GP=12.5 #unitless
P_dB=23 #in dB
P=10**(P_dB/10) #unitless
G=GP*P #unitless
GdB=GP+P_dB #in dB
print "Gain of large antenna = %0.2f "% GdB
#Note : Answer in the book is wrong.
from math import log10
#given data :
print "Open mouth aperture, D = 10*lambda"
print "Power gain : GP = 6*(D/labda)**2"
GP=6*10**2 #unitless
GPdB=10*log10(GP)
print "Power gain = %0.1f dB " %GPdB
#given data :
f=30000. #in MHz
f=f*10**6 #in Hz
d=20 #in feet
d=20*0.3048 #in meter
c=3*10**8 #in m/s
lamda=c/f #in meters
r=2*d**2/lamda #in meters
print "Minimum distance between primary and secondary = %0.2f m" %r
# Answe wrong in the textbook.
#given data :
f=1.2 #in GHz
f=f*10**9 #in Hz
BWFN=5 #in degree
c=3.0*10**8 #in m/s
lamda=c/f #in meters
D=140*lamda/BWFN #in meters
print "Diameter of a paraboloidal reflector = %0.2f m" %D
from math import pi, sqrt, log10
#given data :
f=9.0 #in GHz
f=f*10**9 #in Hz
c=3*10**8 #in m/s
lamda=c/f #in meters
r=35 #in cm
r=r*10**-2 #in meters
Attenuation=9.8 #in dB
#Formula : 10*log10(WT/Wr) = 9.8dB
WTbyWr=10**(Attenuation/10) #unitless
D=(4*pi*r/lamda)*(sqrt(1/WTbyWr)) #unitless
D_dB=10*log10(D)
print "Gain of the horn = %0.2f dB " %D_dB
from math import pi, sqrt, log10
#given data :
ratio = 28 # length:diameter
from sympy import symbols, N
lamda = symbols('lamda')
L = 0.925*lamda
Z = 710+1J*0 # ohm
Zs = 35476/Z # ohm
D = L/ratio
omega = 2*D
print "omega =",N(omega,2)