#given
x=(2*(1/2.0))
a=15
d=53.5*10**-6 #duration for each horizontal line on the reciever
t=1/186000.0 #time delay between direct and reflected signal
#calculation
g=(t/d)*a #ghost width
#result
print"ghost width = ",round(g,2),"in."
#given
S=83 #satellite longitude in degrees
N=90 #site longitude in degrees
L=35 #site longitude in degrees
#calculation
import math
b=0.1512 #constant in equation
A=180+math.atan(math.tan(-7*3.14/180)/math.sin(35*3.14/180))*180/3.14
E=math.atan((math.cos((S-N)*3.14/180)*math.cos(L*3.14/180)-b)/math.sqrt(1-((math.cos(L*3.14/180))**2*(math.cos((S-N)*3.14/180))**2)))*180/3.14
#Result
print"The azimuth is equal to A = ",round(A,0),"degree"
print"the elevation angle = ",round(E,1),"degree"
#given
import math
x=(32+(44/60.0)+(36/3600.0)) # N latitude
y=(106+(16/60.0)+(37/3600.0)) #W longitude
D=42.1642*10**6 #distance from the satellite to the center of the earth
R=6.378*10**6 #earth's radius
a=32.74333*3.14/180.0 #in degree
B=-7.27694*3.14/180.0 #in degree
#calculation
q=math.cos(a)*math.cos(B)
d=math.sqrt(D**2+R**2-(2*D*R*q))
c=2.997925*10**5 #velocity of light
de=d/c
rd=(2*d)/c
#result
print"N longitude converted into degrees = ",round(x,2)
print"W longitude coverted into degrees =",round(y,2)
print"distance = ",round(d/1000,1),"*10**6 meters"
print"delay =",round(de/1000,3),"seconds"
print"roundtrip delay = ",round(rd/1000,3),"seconds"
#given
G=45 #antenna gain
nt=25 #antenna noise temperature
nt1=70 #LNB noise temperature
nt2=2 #noise temperature(reciever and passive components)
#calculation
import math
T=nt+nt1+nt2 #total noise temperature
x=G-10*math.log10(T) #figure of merit
#result
print"Sum of all of the noise temperature contributions Ts = ",T,"k"
print"The figure of merit = ",round(x,2),"dB"
#given
d=41.130383*10**6 #dismath.tance
c=2.997925*10**8 #velocity of light
f=14.25*10**9 #uplink frequency
#calculation
import math
h=c/f #wavelength
x=(4*math.pi*d)/h
Lp=20*math.log10(x) #free-space path loss
#result
print"The wavelength is= ",round(h,2)
print"Lp(dB)= ",round(Lp,2),"dB"
#INcorrect answer of h in the textbook