2
Week10_Solutions.nb
ELEC-E3150 Mathematical Methods
Exercise: 27.11.2016
Name: Maxwell Smart
Student No: 31415X
Return Date: 7.12.2016
Total time spent for solving the problems: 45
min
Feedback concerning this set of exercises: “”
◼ The electron density functions in the ionosphere: execute the
cell below => neDay[h] and neNight[h] (0 ≤ h ≤ 800).
However, a few points have been added into the data to
support continuous definition of the refractive index a bit larger
span of height (-200 ≤ h ≤ 1000)
4
Week10_Solutions.nb
LogPlot[{neDay[h], neNight[h]}, {h, 0, 800}] (* testing electron density functions *)
1012
1011
1010
109
108
107
200
106
400
600
800
◼ Problem 1
Definition of constants
ϵ0 = QuantityMagnitude[UnitConvert[Quantity["ElectricConstant"]]];
(* Permittivity of the vacuum *)
mE = QuantityMagnitude[UnitConvert[Quantity["ElectronMass"]]];
(* The mass of an electron *)
qE = QuantityMagnitude[UnitConvert[Quantity["ElementaryCharge"]]];
(* The chrage of an electron *)
ω = 2 * π * 12 * 10 ^ 6;
nDay[h_] := Sqrt1 - neDay[h] * qE ^ 2 mE * ϵ0 * ω ^ 2
nNight[h_] := Sqrt1 - neNight[h] * qE ^ 2 mE * ϵ0 * ω ^ 2
Plot[{nDay[h], nNight[h]}, {h, 0, 800}]
1.0
0.9
0.8
0.7
0.6
200
400
600
800
Week10_Solutions.nb
Comments: your comments
◼ Problem 2
aE = QuantityMagnitude[Quantity["EarthMeanRadius"], "Kilometers"] // N ;
(* The average radius of the Earth in km *)
The angle between Kaffeklubben Island and the North Pole seen from
middle of Earth (in Radians)
αKaffe = 713.5 aE
0.111992
Illustration of the geometry (for later use)
geomFig = RegionPlot[Sqrt[x ^ 2 + y ^ 2] < aE, {x, - aE * Sin[αKaffe], aE * Sin[αKaffe]},
{y, aE * Cos[αKaffe], aE + 800}, AspectRatio → Automatic, PlotStyle → Green]
7000
6800
6600
6400
-600 -400 -200
0
200
400
600
Solving the rays from Kaffeklubben in day time and searching manually the
proper elevation angle β
n[x_, y_] := nDay[Sqrt[x ^ 2 + y ^ 2] - aE]
(* The refractive index function in day time. Gives an approximation for -200<
h<1000 *)
vars = {x[s], y[s]};
eqns = {D[n[x[s], y[s]] * x '[s], s] ⩵ D[n[x[s], y[s]], x[s]],
D[n[x[s], y[s]] * y '[s], s] ⩵ D[n[x[s], y[s]], y[s]]};
inits = {x[0] ⩵ - aE * Sin[αKaffe], y[0] ⩵ aE * Cos[αKaffe], x '[0] ⩵ Cos[αKaffe + β],
y '[0] ⩵ Sin[αKaffe + β], WhenEvent[Sqrt[x[s] ^ 2 + y[s] ^ 2] - aE ≤ 0,
{xcoord = x[s], ycoord = y[s], smax = s, "StopIntegration"}]};
(* xcoord and ycoord are stored to indicate the position of
where the ray meets the ground *)
sol = NDSolveValueJoin[eqns, inits] /. β → Pi 180 * 34.7, vars, {s, 0, 1000};
5
6
Week10_Solutions.nb
{xcoord, ycoord, smax}
{- 0.150523, 6371.01, 845.424}
ray = ParametricPlot[sol, {s, 0, smax}];
Show[{ray, geomFig}, PlotRange → All]
6550
6500
6450
6400
6350
-600
-400
200
-200
400
600
Comments: Nice hit to the North Pole
Solving the rays from Kaffeklubben in day time
n[x_, y_] := nDay[Sqrt[x ^ 2 + y ^ 2] - aE]
(* The refractive index function in day time. Gives an approximation for -200<
h<1000 *)
vars = {x[s], y[s]};
eqns = {D[n[x[s], y[s]] * x '[s], s] ⩵ D[n[x[s], y[s]], x[s]],
D[n[x[s], y[s]] * y '[s], s] ⩵ D[n[x[s], y[s]], y[s]]};
inits = {x[0] ⩵ - aE * Sin[αKaffe], y[0] ⩵ aE * Cos[αKaffe], x '[0] ⩵ Cos[αKaffe + β],
y '[0] ⩵ Sin[αKaffe + β], WhenEvent[Sqrt[x[s] ^ 2 + y[s] ^ 2] - aE ≤ 0,
{"StopIntegration", AppendTo[smax, {elevation, s}]}],
WhenEvent[Sqrt[x[s] ^ 2 + y[s] ^ 2] - aE ≥ 600,
{"StopIntegration", AppendTo[smax, {elevation, s}]}]};
smax = {};
sol = TableNDSolveValueJoin[eqns, inits] /. β → Pi 180 * elevation, vars, {s, 0, 1500},
{elevation, 10, 70, 5};
rays = ParametricPlot[sol[[#]], {s, 0, smax[[#, 2]]}] & /@ Range[Length[smax]];
(* I prefer to draw the curves one by one
because I computed them over different distances *)
Show[rays, PlotRange → All] (* a rough picture *)
7000
6900
6800
6700
6600
6500
6400
-600
-400
-200
200
400
600
Week10_Solutions.nb
7
Show[{rays, geomFig}, PlotRange → All]
7000
6900
6800
6700
6600
6500
6400
-600
-400
-200
6300
200
400
600
Solving the rays from Kaffeklubben night time
In[50]:=
n[x_, y_] := nNight[Sqrt[x ^ 2 + y ^ 2] - aE]
(* The refractive index function in night time *)
In[56]:=
vars = {x[s], y[s]};
eqns = {D[n[x[s], y[s]] * x '[s], s] ⩵ D[n[x[s], y[s]], x[s]],
D[n[x[s], y[s]] * y '[s], s] ⩵ D[n[x[s], y[s]], y[s]]};
inits = {x[0] ⩵ - aE * Sin[αKaffe], y[0] ⩵ aE * Cos[αKaffe],
x '[0] ⩵ Cos[αKaffe + β], y '[0] ⩵ Sin[αKaffe + β],
WhenEvent[x[s] > 0, {"StopIntegration", AppendTo[smax, {elevation, s}]}],
WhenEvent[y[s] ≥ 6900, {"StopIntegration", AppendTo[smax, {elevation, s}]}]};
In[59]:=
smax = {};
sol = TableNDSolveValueJoin[eqns, inits] /. β → Pi 180 * elevation, vars, {s, 0, 3000},
{elevation, 0, 80, 5}; (* large s becase the first ray is sent to horizon *)
In[60]:=
smax
Out[60]=
{{0, 716.498}, {5, 726.355}, {10, 742.07}, {15, 764.367}, {20, 791.025}, {25, 819.071},
{30, 854.664}, {35, 908.721}, {40, 822.4}, {45, 751.4}, {50, 698.167}, {55, 657.707},
{60, 626.952}, {65, 603.922}, {70, 587.315}, {75, 576.278}, {80, 570.278}}
In[61]:=
rays = ParametricPlot[sol[[#]], {s, 0, smax[[#, 2]]}] & /@ Range[Length[smax]];
(* I prefer to draw the curves one by one
because I computed them over different distances *)
In[62]:=
Show[{rays, geomFig}, PlotRange → All]
6900
6800
6700
Out[62]=
6600
6500
6400
-600
-400
-200
6300
200
400
600
8
Week10_Solutions.nb
Comments: A night time connection is impossible with this frequency.
However, a connection could be established by decreasing it!
© Copyright 2026 Paperzz