-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample_LEO_constellation_bulk_simulation.py
More file actions
130 lines (107 loc) · 4.2 KB
/
example_LEO_constellation_bulk_simulation.py
File metadata and controls
130 lines (107 loc) · 4.2 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
'''
This example demonstrates how to use the LEOConstellationSimulator
to simulate a LEO constellations in bulk.
It includes the following steps:
- Define the loss model using FSPL (Free Space Path Loss).
- Initialize the LEOConstellationSimulator with the desired traffic model
and CSV file for logging performance evaulation dataset.
- Loop through the combinations of parameters and create a LEOConstellationSimulator
object for each combination.
- Add ground stations, aircrafts, set the time, and loss model for the constellation.
- Add shells to the constellation, for this instance the Starlink Shell-1 parameters.
Optionally, add more shells for a multi-shell LEO constellation.
- Run the simulation in parallel for all combinations of parameters.
This example is designed to be run in parallel to speed up the simulation process.
It is important to note that the simulation may take a significant amount of time
to complete, depending on the number of combinations and the complexity of the
constellation.
'''
from LEOCraft.attenuation.fspl import FSPL
from LEOCraft.constellations.LEO_constellation import LEOConstellation
from LEOCraft.dataset import GroundStationAtCities, InternetTrafficAcrossCities
from LEOCraft.satellite_topology.plus_grid_shell import PlusGridShell
from LEOCraft.simulator.LEO_constellation_simulator import \
LEOConstellationSimulator
from LEOCraft.user_terminals.ground_station import GroundStation
def get_loss_model() -> FSPL:
loss_model = FSPL(
28.5*1000000000, # Frequency in Hz
98.4, # Tx power dBm
0.5*1000000000, # Bandwidth Hz
13.6 # G/T ratio
)
loss_model.set_Tx_antenna_gain(gain_dB=34.5)
return loss_model
if __name__ == '__main__':
# Parameters
CSV_FILE = 'performance_log.csv'
TOTAL_SAT = 72*22
MIN_SAT_PER_ORBIT = 10
# Starlink Shell-1
h = 550
e = 25
i = 53
o = 72
n = 22
p = 50
# Time in minutes
t_m = 0
# All possible combinations of orbital planes and satellites per orbital plane for given budget TOTAL_SAT
oxn = []
for orbital_plane in range(MIN_SAT_PER_ORBIT, TOTAL_SAT):
if TOTAL_SAT % orbital_plane == 0 and TOTAL_SAT/orbital_plane >= MIN_SAT_PER_ORBIT:
oxn.append((orbital_plane, int(TOTAL_SAT/orbital_plane)))
# Simulation to be run in parallel
# Add a bulk of simulations for different parameters (i.e., parameters sweeping)
simulator = LEOConstellationSimulator(
InternetTrafficAcrossCities.POP_GDP_100,
# InternetTrafficAcrossCities.ONLY_POP_100,
# InternetTrafficAcrossCities.COUNTRY_CAPITALS_ONLY_POP,
CSV_FILE
)
# for t_m in range(0, 24*60+1, 5):
# for h in range(300, 2000, 10):
# for e in range(5, 85+1, 3):
# for i in range(5, 175+1, 3):
# for p in range(0, 51, 5):
for o, n in oxn:
leo_con = LEOConstellation()
leo_con.add_ground_stations(GroundStation(
GroundStationAtCities.TOP_100
# GroundStationAtCities.COUNTRY_CAPITALS
))
leo_con.set_time(minute=t_m)
leo_con.set_loss_model(get_loss_model())
# Starlink Shell 1
leo_con.add_shells(PlusGridShell(
id=0,
orbits=o,
sat_per_orbit=n,
phase_offset=p,
altitude_m=1000.0*h,
angle_of_elevation_degree=e,
inclination_degree=i
))
# Could add more shells for multi shell LEO constellation
# leo_con.add_shells(PlusGridShell(
# id=1,
# orbits=72,
# sat_per_orbit=22,
# altitude_m=540000.0,
# inclination_degree=53.2,
# angle_of_elevation_degree=25.0,
# phase_offset=p
# ))
# leo_con.add_shells(PlusGridShell(
# id=2,
# orbits=36,
# sat_per_orbit=20,
# altitude_m=570000.0,
# inclination_degree=70.0,
# angle_of_elevation_degree=25.0,
# phase_offset=p
# ))
simulator.add_constellation(leo_con)
# simulator.simulate_in_serial()
simulator.simulate_in_parallel(max_workers=3)
print(f'{CSV_FILE}\tComplete.')