import math
#Initialisation
h=400 #height in Km
pd=1*10**8 #plasma density at height D
pe=1*10**10 #plasma density at height E
pf=3*10**11 #plasma density at height F
Wd=20*10**3 #thickness of D
We=40*10**3 #thickness of E
Wf=190*10**3 #thickness of F
#Calculation
tecd=Wd*pd #total electron content at D
tece=We*pe #total electron content at E
tecf=Wf*pf #total electron content at F
tec=tecd+tece+tecf
tec1=tec*math.sqrt(2) #total electron content
#Results
print'(2) TEC (D) = %.1f x 10^12 el/m^2'%(tecd/10**12)
print' TEC (E) = %.1f x 10^14 el/m^2'%(tece/10**14)
print' TEC (F) = %.2f x 10^16 el/m^2'%(tecf*10**-16)
print'(3) TEC = %.1f x 10^16 el/m^2'%(tec1/10**16)
import math
#Initialisation
N=5*10**11 #Electron density in F layer
#Calculation
F=9*math.sqrt(N) #f0F frequency
#Results
print'(1) hmin = 200Km hmax = 400Km' #from graph
print'(2) F = %.1f Mhz'%(F*10**-6)
import math
#Initialisation
fc=6.3*10**6 #frequency in hertz
#Calculation
f=fc*math.sqrt(2) #maximum usable frequency
#Results
print'Maximum usable frequency = %.3f MHz'%(f*10**-6)
import math
#Initialisation
tec=10**17 #total electron content
H=200*10**3 #thickness of F layer
#Calculation
pd=tec/H #plasma density at F
fc=9*math.sqrt(pd)
ouf=3.6*fc*0.8 #optimum usable frequency
muf=fc*1.788 #maximum usable frequency
#Results
print'Maximum usable frequency = %.1f MHz'%(fc*10**-6)
print'Optimum usable frequency < %.3f MHz'%(ouf*10**-6)
print'Maximum usable frequency (30) = %.1f MHz'%(muf*10**-6)
import math
#Initialisation
d=1000 #distance in km
re=6370 #earth radius in km
dt=30 #in degree
#Calculation
teta=d*(2*re)**-1 #theta in radians
tet=teta*180*math.pi**-1 #theta in degree
w1=90-dt-tet
a=math.sin(w1*3.14/180)/re
a1=math.sin((90+dt)*3.14/180)
h=(a1*a**-1)-re #height
#Results
print'(1) virtual height of the reflection point = %d km'%h #wrong value calculated in textbook
import math
#Initialisation
d=200 #height in Km
f=700 #frequency in Khz
#Calculation
T1e=0.4 #from graph 4.10
T2e=0.9
T3e=1.7
T1f=1.3
T2f=2.8
T3f=4.3
Tef=0.3
Tef1=2.7
Tef2=0.5
#Results
print'(1) Time delay of E layer, Td(1E) = %.1f ms'%T1e
print' Td(2E) = %.1f ms'%T2e
print' Td(2E) = %.1f ms'%T3e
print' Time delay of F layer, Td(1F) = %.1f ms'%T1f
print' Td(2F) = %.1f ms'%T2f
print' Td(2F) = %.1f ms'%T3f
print'(2) Time delay of E and F for a distance of 500 km, Td(E,F) = %.1f ms'%Tef
print'(3) Td(1F,3F) = %.1f ms'%Tef1
print' Td(1E,3E) = %.1f ms'%Tef2
import math
#Initialisation
f=1.5*10**9 #frequency in Hz
tec=10**18 #total electron content
g=5*10**-3 #geomagnetic field intensity
a=3.36*10**2
#Calculation
teta= a*g*tec*(f**-2) #Faraday rotation in Radian
c=0.8422
x=20*math.log10(c) #loss value in dB
#Results
print'(1) Faraday rotation = %.1f Rad'%teta
print'(2) Loss = %f dB'%x
import math
#Initialisation
tec1=10**18 #total electron content
f=1.5 #frequency in Hertz
tec2= 10**17 #total electron content
#Calculation
teta = 600 #Faraday rotation in mRadian
T=5 #time delay in ns
gd=0.5 #time delay difference in ns
#Results
print'(1) Faraday rotation = %d mRad'%teta
print'(2) Time delay = %d ns'%T
print'(3) G/D = %.1f ns'%gd
import math
#Initialisation
phi=166 #in radian
t=35*math.pi/180 #geographic latitude in radian
t1=60*math.pi/180 #zenith angle in radian
N=80*math.pi/180 #in radian
x=92
y=35
h=35
p=1.2
#Calculation
m=0.11-0.49*math.cos(t)
fe=0.004*(1+0.021*166)**2 #minimum value of f0E
A=1+0.0094*(phi-66) #A value
B=(math.cos(N))
B1=B**m #B value
C=x+y*math.cos(t) #C value
D=math.cos(t1)**p #D value
F=(A*B*C*D)**(0.25) #exact value of f0E
#Results
print'(1) Minimum value of f0E = %.2f x 10^-2 MHz'%(fe*100)
print'(2) f0E = %.2f MHz'%F #wrong value calculated in textbook
import math
#Initialisation
g=50 #geomagnetic latitude in degree
R12=100 #solar activity number
x=60*math.pi/180 #zenith angle in radians
#Calculation
f0=4.35+0.0058*g-0.00012*g**2
f100=5.35+0.011*g-0.00023*g**2
fs=f0+0.01*(f100-f0)*R12
n=0.093+(0.00461*g)-(0.000054*(g**2))+(0.0031*R12) #wrong value calculated in textbook
F1=fs*(math.cos(x))**n #critical frequency
#Results
print'Critical Frequency = %.2f MHz'%F1 #wrong value calculated in textbook
import math
#Initialisation
R12=150 #12 month average value
fs0=4.416
fs100=5.473
n=0.23
x=45*math.pi/180 #zenith angle in radians
#Calculation
f1=63.7+0.728*R12+0.00089*R12**2
fs=fs0+0.01*(fs100-fs0)*R12
F1=fs*(math.cos(x))**n #critical frequency #zenith angle in radians
#Results
print'(1) R12 = %d'%R12
print'(2) F12 = %d'%f1
print'(3) f0F1 = %.2f MHz'%F1