/
ground.jl
87 lines (68 loc) · 2.74 KB
/
ground.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# # Ground
#
# LongwaveModePropagator treats the ground boundary of the Earth-ionosphere waveguide
# as a homogeneous, nonmagnetic material described by its electrical conductivity ``\sigma``
# and relative permittivity ``\epsilon_r``.
#
# In this example we'll compare the effect of ground conductivity on amplitude along
# the ground in the waveguide for day and nighttime ionospheres.
using Plots, Printf
using LongwaveModePropagator
const LMP = LongwaveModePropagator
nothing #hide
# LWPC uses standard ground indices to describe combinations of relative permittivity
# and conductivity.
# The standard indices can be accessed from LMP as [`GROUND`](@ref).
sort(GROUND)
# We'll define all of the constant types and the day and night profiles.
## Constant values
const BFIELD = BField(50e-6, π/2, 0)
const TX = Transmitter(20e3)
const RX = GroundSampler(0:5e3:3000e3, Fields.Ez)
const DAY = Species(LMP.QE, LMP.ME, z->waitprofile(z, 75, 0.3), electroncollisionfrequency)
const NIGHT = Species(LMP.QE, LMP.ME, z->waitprofile(z, 82, 0.6), electroncollisionfrequency)
nothing #hide
# We'll define a function to which we can pass the day or night `Species` and return the
# electric field amplitude.
function varyground(prf)
amps = Vector{Vector{Float64}}(undef, length(GROUND))
for i = 1:length(GROUND)
wvg = HomogeneousWaveguide(BFIELD, prf, GROUND[i])
E, a, p = propagate(wvg, TX, RX)
amps[i] = a
end
return amps
end
nothing #hide
# And here's a function to plot each of the curves.
function buildplots!(p, amps)
cmap = palette(:thermal, length(GROUND)+1) # +1 so we don't get to yellow
for i = 1:length(GROUND)
plot!(p, RX.distance/1000, amps[i];
label=@sprintf("%d, %.1g", GROUND[i].ϵᵣ, GROUND[i].σ), color=cmap[i]);
end
end
nothing #hide
# First, the daytime results.
amps = varyground(DAY)
p = plot()
buildplots!(p, amps)
plot!(p; size=(600,400), ylims=(0, 95), title="Day", legend=(0.85, 1.02),
xlabel="Range (km)", ylabel="Amplitude (dB)", legendtitle="ϵᵣ, σ")
#md savefig(p, "ground_day.png"); nothing # hide
#md # ![](ground_day.png)
# And now nighttime.
amps = varyground(NIGHT)
p = plot()
buildplots!(p, amps)
plot!(p; size=(600,400), ylims=(0, 95), title="Night", legend=(0.85, 1.02),
xlabel="Range (km)", ylabel="Amplitude (dB)", legendtitle="ϵᵣ, σ")
#md savefig(p, "ground_night.png"); nothing # hide
#md # ![](ground_night.png)
# Low ground conductivity can have a significant influence on the signal propagation -
# there is strong attenuation.
# These low conductivities can be found in areas of sea or polar ice and industrial or
# city areas.
#
# The influence of ground conductivity on the received signal has similar impact on
# the day and night scenarios.