from math import sqrt
#Variable declaration
muf = 10e6 #Maximum usable frequency (Hz)
h = 300 #Height of reflection (km)
n = 0.9 #Maximum value of refractive index (unitless)
#Calculations
Nmax = (1 - n**2)*(muf**2)/81 #Max. Number of electrons per cubic cm
fc = 9*sqrt(Nmax) #Critical frequency (Hz)
dskip = 2*h*sqrt((muf/fc)**2 - 1) #Skip distance (km)
#Result
print "The skip distance is", round(dskip,1), "km"
#Numerical error in the calculation of sqrt((muf/fc)**2 - 1)
#Variable declaration
fE = 3e6 #Critical frequency for E layer (Hz)
fF1 = 5e6 #Critical frequency for F1 layer (Hz)
fF2 = 9e6 #Critical frequency for F2 layer (Hz)
#Calculations
N_E = (fE**2)/81 #Concentration of electrons in E layer (per cubic cm)
N_F1 = (fF1**2)/81 #Concentration of electrons in F1 layer (per cubic cm)
N_F2 = (fF2**2)/81 #Concentration of electrons in F2 layer (per cubic cm)
#Result
print "The concentration of electrons in E layer is", round(N_E,-8), "per cubic cm"
print "The concentration of electrons in F1 layer is", round(N_F1,-8), "per cubic cm"
print "The concentration of electrons in F2 layer is", N_F2, "per cubic cm"
from math import sqrt
#Variable declaration
N_E = 0.8*0.111e12 #Concentration of electrons in E layer (per cubic cm)
N_F1 = 0.8*0.3086e12 #Concentration of electrons in E layer (per cubic cm)
N_F2 = 0.8*1e12 #Concentration of electrons in E layer (per cubic cm)
#Calculations
fE = 9*sqrt(N_E) #Critical frequency in E layer (Hz)
fF1 = 9*sqrt(N_F1) #Cricital frequency in F1 layer (Hz)
fF2 = 9*sqrt(N_F2) #Critical frequency in F2 layer (Hz)
#Result
print "The Critical frequency in E layer is", round(fE,-4),"Hz"
print "The Critical frequency in F1 layer is", round(fF1,-4),"Hz"
print "The Critical frequency in F2 layer is", round(fF2,-3),"Hz"
from math import cos, sqrt, pi
#Variable declaration
hD = 70 #Height of D layer (km)
hE = 130 #Height of E layer (km)
hF1 = 230 #Height of F1 layer (km)
hF2 = 350 #Height of F2 layer (km)
theta = 10*pi/180 #Angle of incidence (radians)
#Calculations
temp = sqrt((cos(theta))**-2 - 1)
d1 = 2*hD*temp #Maximum single hop distance for D layer (km)
d2 = 2*hE*temp #Maximum single hop distance for E layer (km)
d3 = 2*hF1*temp #Maximum single hop distance for F1 layer (km)
d4 = 2*hF2*temp #Maximum single hop distance for F2 layer (km)
#Result
print "The Maximum single hop distance for D layer is", round(d1,1), "km"
print "The Maximum single hop distance for E layer is", round(d2,2), "km"
print "The Maximum single hop distance for F1 layer is", round(d3,2), "km"
print "The Maximum single hop distance for F2 layer is", round(d4,1), "km"
from math import pi, sqrt, cos
#Variable declaration
d = 200 #Height of layer (km)
beta = 20 #Takeoff angle (degrees)
R = 6370 #Earth's radius (km)
#Calculations
phi_0 = 90 - beta #Take off angle for flat earth (degrees)
h = (d/2)/(sqrt((cos(phi_0*pi/180)**-2) - 1)) #Skip distance for case (a) (km)
phi_02 = 90 - beta - 57.2*d/(2*R)
#Take off angle for spherical earth (degrees)
h2 = (d/2)/(sqrt((cos(phi_02*pi/180)**-2) - 1))
#Skip distance for case (b) (km)
#Result
print "The skip distance for case (a) is", round(h,3), "km"
print "The skip distance for case (b) is", round(h2,2), "km"