Values changining after a satellite is initialized.

Hi,
Below is the code which I am using in order to create a satellite scenario. I have defined all the required parameters manually that are required to initialize a satellte, but I am not able to understand why are they getting changed after the satellite is initialized.
startTime = datetime('27-Jun-2024 13:23:02');
stopTime = startTime + seconds(60*100);
sampleTime = 10;
sc = satelliteScenario(startTime,stopTime,sampleTime);
mu = 3.986004418*1e14;
n = 15.06398680175205;
semiMajorAxis = nthroot(mu,3)/(((2*n*pi)/86400)^(2/3)) ;
trueAnomaly = 341.2089;
Eccentricity = 1.249e-04;
Inclination = 53.0534;
RightAscensionOfAscendingNode = 242.3386;
ArgumentOfPeriapsis = 94.5842;
sat = satellite(sc,semiMajorAxis,Eccentricity,Inclination,RightAscensionOfAscendingNode,ArgumentOfPeriapsis,trueAnomaly);
elements = orbitalElements(sat)
elements = struct with fields:
MeanMotion: 0.0628 Eccentricity: 1.2490e-04 Inclination: 53.1730 RightAscensionOfAscendingNode: 242.7010 ArgumentOfPeriapsis: 94.5031 MeanAnomaly: 341.2135 Period: 5.7355e+03 Epoch: 27-Jun-2024 13:23:02 BStar: 0
I would really appreciate if someone can help me figure out why are the values of RAAN and ArgumentOfPeriapsis getting changed after the satellite is initialized.
Thank you

8 Comments

Hi Raghav,
I used the code snippet provided by you, but I am unable to replicate the issue.
The variables "ArgumentOfPeriapsis" and "RightAscensionOfAscendingNode" show expected behaviour, and their values are "94.5842" and "242.3386" respectively. Could you share more information on the issue?
Hi Amish,
Thanks for taking a look at it.
It is really strange that you were unable to replicate the issue.
I tried the same code of different systems and I am getting the same result.
Here is the TLE information I used to get the required values.
1 47641C 21012X 24179.14770833 .00007445 00000+0 49891-3 0 1797
2 47641 53.0534 242.3386 0001249 94.5842 341.2135 15.06386781 15
Hi @ Raghav Rathi,
The only issue I can think of after analyzing your code and provided data, if the angles provided (RAAN and Argument of Periapsis) are in the correct units and formats expected by the satellite initialization functions. For example, angles like RAAN and Argument of Periapsis are typically specified in degrees, so make sure the values are converted to degrees if they are in radians.Hope, this helps.
@Umar Thanks for replying, but the values of RAAN and Argument of Periapsis are already defined in degree in the TLE file.
Which MATLAB release did you happen to test on?
The poster is using R2023b -- but running the code here in MATLAB Answers, using R2024a, is producing the same result.
Hi @ Raghav Rathi,
Also, I have noticed carefully now that TLE information you provided is not directly being used to initialize the satellite, and instead, you are manually defining parameters such as semiMajorAxis, Eccentricity, Inclination, RightAscensionOfAscendingNode, ArgumentOfPeriapsis, and trueAnomaly. So, when you initialize a satellite using the Aerospace Toolbox satellite function with manual parameter inputs, it's possible that these values are being overridden by the TLE-derived elements. So, my approach at this point would be parsing the TLE data and extract the relevant parameters needed to initialize the satellite. This involves converting the TLE data into orbital elements such as semi-major axis, eccentricity, inclination, right ascension of ascending node, argument of periapsis, and mean anomaly. Once you have extracted these values from the TLE, you can then use them to initialize the satellite in your scenario. By doing so, you can ensure that the satellite's parameters are accurately defined based on the TLE information. By incorporating this approach into your code, you can achieve consistency between the manually defined parameters and those derived from the TLE data. This will help in resolving any discrepancies or changes observed after satellite initialization.
Secondly, be aware of potential issues related to data reliability. Data derived from TLEs older than 30 days can become unreliable, and it's recommended to calculate orbital positions using algorithms such as Simplified General Perturbations-4 (SGP4) and Simplified Deep-Space Perturbations-4 (SDP4). To resolve this problem, consider using TLE data directly as input for satellite initialization in MATLAB's Aerospace Toolbox. By obtaining reliable TLE files from sources such as the Space Track website, you can ensure that the orbital elements, including RAAN and Argument of Periapsis, are accurately defined based on current information.
I would also recommend reviewing materials by clicking the following links below.
Hope this helps.
@Umar, Thank you for the explaination.

Sign in to comment.

 Accepted Answer

Hello Raghav,
I ran your code snippet on MATLAB R2023b and was able to reproduce the same outputs. The discrepancies between the input angles and the output of the “orbitalElements” function are due to the way the different input methods to the “satellite” function are handled.
When the “satellite” object is initialized by passing Keplerian elements defined in the Geocentric Celestial Reference Frame (GCRF), the function internally computes the ‘position’ and ‘velocity’ of the satellite in the True Equator Mean Equinox (TEME) frame. These are then further used to compute the Keplerian elements’ values in the TEME frame. Thus, the values returned by the “orbitalElements” function are different from the inputs since they represent the transformed values of the input in the TEME frame.
When the “satellite” object is initialized using a file-based input argument, the values remain consistent. You can use the following code snippet to write your TLE information to a TXT file and then use it to initialize a “satellite” object:
% Define the TLE data
line1 = 'Satellite 1';
line2 = '1 47641C 21012X 24179.14770833 .00007445 00000+0 49891-3 0 1797';
line3 = '2 47641 53.0534 242.3386 0001249 94.5842 341.2135 15.06386781 5';
% Open a file for writing
filename = 'satellite.tle';
fileID = fopen(filename, 'w');
% Check if the file opened successfully
if fileID == -1
error('Failed to open file for writing.');
end
% Write the TLE lines to the file
fprintf(fileID, '%s\n', line1);
fprintf(fileID, '%s\n', line2);
fprintf(fileID, '%s\n', line3);
% Close the file
fclose(fileID);
% Display a message indicating success
disp(['TLE file written to ', filename]);
TLE file written to satellite.tle
% Set the scenario
startTime = datetime('27-Jun-2024 13:23:02');
stopTime = startTime + seconds(60*100);
sampleTime = 10;
sc = satelliteScenario(startTime,stopTime,sampleTime);
% Add the satellite
sat = satellite(sc,'satellite.tle');
elements = orbitalElements(sat)
elements = struct with fields:
MeanMotion: 0.0628 Eccentricity: 1.2490e-04 Inclination: 53.0534 RightAscensionOfAscendingNode: 242.3386 ArgumentOfPeriapsis: 94.5842 MeanAnomaly: 341.2135 Period: 5.7356e+03 Epoch: 27-Jun-2024 03:32:41 BStar: 4.9891e-04
For further understanding, kindly refer to the following MathWorks Documentation:
I hope you find the above explanation and suggestions useful!

4 Comments

Hi @ Garmit Pant,
The point that you made was very important to notice, “ When the “satellite” object is initialized by passing Keplerian elements defined in the Geocentric Celestial Reference Frame (GCRF), the function internally computes the ‘position’ and ‘velocity’ of the satellite in the True Equator Mean Equinox (TEME) frame. These are then further used to compute the Keplerian elements’ values in the TEME frame. Thus, the values returned by the “orbitalElements” function are different from the inputs since they represent the transformed values of the input in the TEME frame.”
This is because GCRF serves as a reference for defining the initial orbital parameters, and these are then transformed into the TEME frame for further analysis and calculations. I would like to elaborate further that the process involves converting the Keplerian elements from the GCRF to the TEME frame, allowing for a more precise representation of the satellite's orbital characteristics. This transformation is crucial for accurately determining the satellite's position and velocity relative to the Earth's true equator and mean equinox. By utilizing this approach, it becomes possible to establish a comprehensive understanding of the satellite's orbital dynamics within a specific reference frame. Also, this process plays a pivotal role in satellite operations and contributes to the overall accuracy and efficiency of space missions. Very good analysis.
Thanks for the explaination.
I did notice that when I initialized a satellite using TLE file, all the parameters were exactly the same.
Except I was not able to understand what math was done on MeanMotion as the value gets converted from 15.06386781 rev./day to 0.0628.
The reason I am trying to manually initialize a satellite is to verify that whether the TLE file is outdated.
I am actually performing some analysis on Starlink satellites and sometimes the doppler rate of the detected satellites(calculated from the received signal) does not match the estimated rate (calculated using the TLE data).
I know this is not the right way but its just something I was trying to do.
Also, is there any documentation where its mentioned how the "satellite()" calculates the semiMajorAxis and other information needed to create a satellite path in the satellite scenario.
I really appreciate your help.
Thanks

Sign in to comment.

More Answers (0)

Products

Release

R2023b

Community Treasure Hunt

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

Start Hunting!