Calculate Satellite TLE from Satellite Object

98 visualizaciones (últimos 30 días)
David Huynh
David Huynh el 19 de Abr. de 2023
Comentada: chicken vector el 20 de Abr. de 2023
I would like to create a Walker Delta constellation using the walkerDelta function (this I can do following the online example). I would then like to take the satellite objects and calculate the corresponding TLE data and output them to a file. I have not been able to find a function that takes a satellite object and computes the corresponding TLE data, other than this poorly reviewed submission. Is there a built-in way to do this with the Aerospace toolbox?

Respuesta aceptada

chicken vector
chicken vector el 19 de Abr. de 2023
Editada: chicken vector el 20 de Abr. de 2023
The reason why you haven't found a method is because it doesn't make sense physically.
TLE are data format that condense information about a satellite, such as the epoch of launch, the catalogue number and other designators.
You also have properties depending on the effects of perturbations on the orbit (B*). In LEO, perturbations are mainly due to drag, which strictly depends on the satellite intrinsic properties, such as the area-to-mass ratio.
An other parameter included in TLEs is the number of revolutions that the satellite has performed since insertion into orbit.
All these features makes it impossibile to construct TLE that make sense for fictitious satellites that don't exist in reality.
If you really want to generate some TLE, you could extrapolate the orbital parameters from the simulations and fill in blank the other characteristic, but I am relatively sure you won't find a working function for that.
If you are okay with dealing with fake TLE, you can use the following to generate them.
Feel free to modify the parameters as you prefer.
% Constellation from openExample('aero/ModelGalileoConstellAsWalkerDeltaConstellExample'):
sc = satelliteScenario;
sat = walkerDelta(sc, 29599.8e3, 56, 24, 3, 1, ArgumentOfLatitude=15, Name="Galileo");
% Initialise:
N = length(sat);
TLE = cell(N,1);
% Loop over satellites to extract TLEs:
for j = 1 : N
TLE{j} = getTLE(sc.Satellites(j));
end
% Generate TLE from satellite:
function TLE = getTLE(satellite)
%% Line 1:
% ID:
ID = num2str(satellite.ID, '%05.f');
% Time:
now = datetime;
currentYear = year(now);
yearStart = [num2str(currentYear) '-01-01'];
yearDigits = yearStart(3:4);
currentEpoch = convertTo(now, 'epochtime', 'Epoch', yearStart) / 86400;
epoch = num2str(currentEpoch, '%012.08f');
% Rocket launch:
RocketLaunches2022 = 180;
launchNumber = num2str(round((RocketLaunches2022 * currentEpoch) / 360), '%03.f');
% Line 1:
lineData = ['1 ' ID 'S ' yearDigits launchNumber 'A ' yearDigits epoch ' +.00000000 +00000-0 +00000-0 0 000'];
firstLine = [lineData checksum(lineData)];
%% Line 2:
% Orbital data:
i = num2str(satellite.orbitalElements.Inclination, '%08.04f');
OM = num2str(satellite.orbitalElements.RightAscensionOfAscendingNode, '%08.04f');
e = num2str(satellite.orbitalElements.Eccentricity * 1e7, '%07.f');
om = num2str(satellite.orbitalElements.ArgumentOfPeriapsis, '%08.04f');
th = num2str(satellite.orbitalElements.TrueAnomaly, '%08.04f');
n = num2str(86400 / satellite.orbitalElements.Period, '%011.08f');
% Line 2:
lineData = ['2 ' ID ' ' i ' ' OM ' ' e ' ' om ' ' th ' ' n '00000'];
secondLine = [lineData checksum(lineData)];
TLE = [firstLine;secondLine];
end
% Compute checksum for last line digit:
function cs = checksum(line)
digits = strrep(line, '-', '1');
signs = {'+','A','S',' ','0','.'};
for j = 1 : length(signs)
digits = erase(digits, signs{j});
end
sum = 0;
for j = 1 : length(digits)
sum = sum + str2num(digits(j));
end
sum = num2str(sum);
cs = sum(end);
end
Result:
TLE{N/2 + 1}
ans =
2×69 char array
'1 00013S 23055A 23109.00000000 +.00000000 +00000-0 +00000-0 0 0007'
'2 00013 056.0000 120.0000 0000000 000.0000 210.0000 01.70478493000006'
  2 comentarios
David Huynh
David Huynh el 20 de Abr. de 2023
Thank you for the thorough and educational response! I appreciate you explaining the purpose of TLE data, it makes sense. What I was looking for was a means to generate "fake TLE" as you said, really just as a way to encode the orbital parameters. And your function does exactly that.
chicken vector
chicken vector el 20 de Abr. de 2023
My pleasure

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre CubeSat and Satellites en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by