There was a serious error in the calculation of the satellite position
3 views (last 30 days)
Show older comments
When I was using "satelliteScenario" and "satellite" to set.
satellite(scenario,semimajoraxis,eccentricity,inclination,RAAN,argofperiapsis,trueanomaly) adds a Satellite object from Keplerian elements defined in the Geocentric Celestial Reference Frame (GCRF) to the satellite scenario.
different starttime will influence the position of the satellite.
clear all
sem = 6888e3;
ecc = 0.001;
inclination = 85 ;
RAAN = 60;
ARGOFPERIAPSIS = 85;
TrueAnomaly = 130;
startTime = datetime('2024-05-05 03:00:00','TimeZone','UTC');
% startTime = datetime('2024-05-05 04:00:00','TimeZone','UTC');
stopTime = startTime + hours(2);
sampleTime = 1; % seconds
sc= satelliteScenario(startTime,stopTime,sampleTime);
the same UTC time but different satellite position.
0 Comments
Answers (1)
Ashok
on 28 Aug 2024
Hello Ruizhe,
From the code you have shared, I can comprehend that you are creating a satellite simulation using the “satelliteScenario” function and later adding a satellite object to the simulation using the ”satellite” function.
According to my observation, the value passed to the argument “trueanomaly” of the “satellite” function, is interpreted to be the true anomaly of the satellite at the start of the simulation. The start time of the simulation can be set using the argument “startTime” in the “satelliteScenario” function. Make sure you are sending the appropriate value of true anomaly to the “satellite” function.
You can find the true anomaly at a given time stamp using vectorial relations. Alternatively, If the true anomaly of the satellite is known at a given time stamp, you can find the true anomaly at any future time stamp using the “advance” method of the “satelliteScenario” class as well.
Example:
Let’s say that the true anomaly is 130° at 2024-05-05 03:00:00 UTC, then you can find the true anomaly at 2024-05-05 04:00:00 UTC (one hour later) using the “advance” method of the “satelliteScenario” class as follows:
% Satellite' Orbital Parameters (Same for both the scenarios)
sem = 6888e3;
ecc = 0.001;
inclination = 85 ;
RAAN = 60;
ARGOFPERIAPSIS = 85;
TrueAnomaly_3am = 130;
% Creating and displaying first scenario with the satellite
startTime1 = datetime('2024-05-05 03:00:00','TimeZone','UTC');
stopTime1 = startTime1 + hours(2);
sampleTime1 = 1; % seconds
sc1 = satelliteScenario(startTime1,stopTime1,sampleTime1);
sat1 = satellite(sc1, sem, ecc, inclination, RAAN, ARGOFPERIAPSIS, TrueAnomaly_3am,...
"OrbitPropagator","two-body-keplerian");
% Start time of the second scenario
startTime2 = datetime('2024-05-05 04:00:00','TimeZone','UTC');
% Finding the true anomaly using the first satelliteScenario ('sc1')
timeDiff = seconds(startTime2-startTime1);
sc1.AutoSimulate = false;
for i = 1:round(timeDiff/sampleTime1)
sc1.advance;
end
sat1Orb = orbitalElements(sat1);
TrueAnomaly_4am = sat1Orb.TrueAnomaly;
sc1.AutoSimulate = true;
This would give “TrueAnomaly_4am” as 357.6445° which is the true anomaly at 2024-05-05 04:00:00 UTC. Finally, as expected, the position of the satellite in the two simulations are in sync, as seen in the attached image.
However, note that this procedure of finding the true anomaly might be slow depending on the time interval (“timeDiff”) and the sample time (“sampleTime1”). In such cases, you can use the “propagateOrbit” function to find the position and velocity vectors of the satellite at a desired time stamp, followed by the “ijk2keplerian” function to get the Keplerian orbit elements form the position and velocity vectors. The corresponding references are as follows:
Reference for the “satellite” function:
I hope this helps!
0 Comments
See Also
Categories
Find more on Reference Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!