from __future__ import division
from math import sqrt, log10
#Given
Pt1=100#Radiated power
Pt2=30# Reduced Power
r=1#assume distance to be unity for easeof calculation
E1=300*sqrt(100)/r
E2=300*sqrt(30)/r
E=20*log10((E2/E1))# Reduction in field strength in dBs
print 'Field strength will reduce by %0.2f dBs'%(-E)
#Given
P=3#Transmitter power
ht=100# Antenna height
G=5#Antenna gain
d=20e3#distance
lamda=1
hr=1#assumed
E=((88*G*ht*hr*P**0.5)/(lamda*d**2))#field strength
print 'The field strength at distance 20km is %0.2f uV/m'%(E*1e6)
from math import sqrt
#Given
ht=152.5
hr=9.15 # Antenna height
d=4100*(sqrt(ht)+sqrt(hr)) #distance
print 'Direct ray coverage is possible over %0.2f km'%(d*1e-3)
from math import sqrt
#Given
#b
ht=3e3
hr=5e3 # Antenna height
d=4100*(sqrt(ht)+sqrt(hr))#distance
print 'Max possible distance for efective point to point\n communication is %0.2f km'%(d*1e-3)