Values changining after a satellite is initialized.
15 次查看(过去 30 天)
显示 更早的评论
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)
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 个评论
Umar
2024-8-6
编辑:Walter Roberson
2024-8-6
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.
采纳的回答
Garmit Pant
2024-8-6
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]);
% 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)
For further understanding, kindly refer to the following MathWorks Documentation:
- Refer to the ‘Input Arguments’ section to understand different methods of initialising a “satellite” object: https://www.mathworks.com/help/releases/R2023b/aerotbx/ug/satellitescenario.satellite.html#mw_0e009042-cc9a-46c0-9514-d5019692ca22
- Refer to the ’Two Line Element (TLE) Files’ section to understand the TLE standard: https://www.mathworks.com/help/releases/R2023b/satcom/gs/satelliteScenario-key-concepts.html#mw_e08739b4-c5da-4983-898b-56e18cc71f87
I hope you find the above explanation and suggestions useful!
4 个评论
Garmit Pant
2024-8-12
I have addressed the calculation of SemiMajorAxis in this post: https://www.mathworks.com/matlabcentral/answers/2140276
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scenario Generation and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!