Platform velocity different than 0 in ECEF coordinates
I am testing MATLAB satellite scenarios and coordinates frames. So I define a satellite scenario, and then I define a platform with a 0 velocity trajectory. Then I call the states function to get the position and velocity of the platform.
By default, the coordinate frame used by the states function is GCRF (inertial), therefore I would expect that my platform would have non-0 velocity and therefore a changing position due to the rotation of the Earth. On the other side, I would expect my platform to have 0 velocity and fixed position when I call states using ECEF coordinate frame, since it rotates along with the Earth, and any object on the surface of the Earth will be fixed in this coordinate system.
What I get when calling the states function is that positions behave as they should, that is, they are constant in the ECEF frame and variable in the GCRF (inertial) frame, but the velocities are weird. The velocities are non-0 (and are even variable) on ECEF coordinate system, and they are constant (non-0) on the GCRF (inertial) frame, which also doesn’t make sense because as the Earth rotates, the orientation of the velocity vector of my platform should change direction.
The funny thing is that when I call the states function specifying a datetime timeIn, the velocities do behave as they are supposed to, that is, they are 0 in the ECEF frame, and variable non-0 in the GCRF frame. This suggests that either there is something wrong in the implementation of the states function for platforms, or I’m doing something wrong in the definition of the platform and/or the call to the states function, so here is my code:
%% Satellite scenario parameters
mission.StartDate = datetime(2023,10,9,7,10,0,TimeZone="America/New_York");
mission.Duration = minutes(10);
mission.stopTime = mission.StartDate + mission.Duration;
sampleTime = 60; %seconds
mission.scenario = satelliteScenario(mission.StartDate,mission.stopTime,sampleTime);
%% Aircraft Trajectory
waypoints = [… % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;…
40.6289,-73.7738,3;…
];
timeOfArrival = duration([… % time (HH:mm:ss)
"00:00:00";…
"00:10:00"]);
geo_traj = geoTrajectory(waypoints,seconds(timeOfArrival));
aircraft.obj = platform(mission.scenario,geo_traj);
%% States
[pos_ine,vel_ine]=states(aircraft.obj) % Inertial, pos should be variable and vel should be variable (norm(vel) should be constant)
[pos_ecef,vel_ecef]=states(aircraft.obj,"c","ecef") % ECEF, pos should be constant, vel should be 0
% When specifying a time for evaluation, velocity behaves as expected
time = datetime(2023,10,9,7,11,0,TimeZone="America/New_York"); % t = 1 min
[~,vel1_ine]=states(aircraft.obj,time)
[~,vel1_ecef]=states(aircraft.obj,time,"c","ecef")
% vel2_ine should be different than vel1_ine, but norm(vel1_ine) should be equal to norm(vel2_ine)
% vel1_ecef and vel2_ecef should be 0
time = datetime(2023,10,9,7,19,0,TimeZone="America/New_York"); % t = 9 min
[~,vel2_ine]=states(aircraft.obj,time)
[~,vel2_ecef]=states(aircraft.obj,time,"c","ecef")
norm(vel1_ine)-norm(vel2_ine)I am testing MATLAB satellite scenarios and coordinates frames. So I define a satellite scenario, and then I define a platform with a 0 velocity trajectory. Then I call the states function to get the position and velocity of the platform.
By default, the coordinate frame used by the states function is GCRF (inertial), therefore I would expect that my platform would have non-0 velocity and therefore a changing position due to the rotation of the Earth. On the other side, I would expect my platform to have 0 velocity and fixed position when I call states using ECEF coordinate frame, since it rotates along with the Earth, and any object on the surface of the Earth will be fixed in this coordinate system.
What I get when calling the states function is that positions behave as they should, that is, they are constant in the ECEF frame and variable in the GCRF (inertial) frame, but the velocities are weird. The velocities are non-0 (and are even variable) on ECEF coordinate system, and they are constant (non-0) on the GCRF (inertial) frame, which also doesn’t make sense because as the Earth rotates, the orientation of the velocity vector of my platform should change direction.
The funny thing is that when I call the states function specifying a datetime timeIn, the velocities do behave as they are supposed to, that is, they are 0 in the ECEF frame, and variable non-0 in the GCRF frame. This suggests that either there is something wrong in the implementation of the states function for platforms, or I’m doing something wrong in the definition of the platform and/or the call to the states function, so here is my code:
%% Satellite scenario parameters
mission.StartDate = datetime(2023,10,9,7,10,0,TimeZone="America/New_York");
mission.Duration = minutes(10);
mission.stopTime = mission.StartDate + mission.Duration;
sampleTime = 60; %seconds
mission.scenario = satelliteScenario(mission.StartDate,mission.stopTime,sampleTime);
%% Aircraft Trajectory
waypoints = [… % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;…
40.6289,-73.7738,3;…
];
timeOfArrival = duration([… % time (HH:mm:ss)
"00:00:00";…
"00:10:00"]);
geo_traj = geoTrajectory(waypoints,seconds(timeOfArrival));
aircraft.obj = platform(mission.scenario,geo_traj);
%% States
[pos_ine,vel_ine]=states(aircraft.obj) % Inertial, pos should be variable and vel should be variable (norm(vel) should be constant)
[pos_ecef,vel_ecef]=states(aircraft.obj,"c","ecef") % ECEF, pos should be constant, vel should be 0
% When specifying a time for evaluation, velocity behaves as expected
time = datetime(2023,10,9,7,11,0,TimeZone="America/New_York"); % t = 1 min
[~,vel1_ine]=states(aircraft.obj,time)
[~,vel1_ecef]=states(aircraft.obj,time,"c","ecef")
% vel2_ine should be different than vel1_ine, but norm(vel1_ine) should be equal to norm(vel2_ine)
% vel1_ecef and vel2_ecef should be 0
time = datetime(2023,10,9,7,19,0,TimeZone="America/New_York"); % t = 9 min
[~,vel2_ine]=states(aircraft.obj,time)
[~,vel2_ecef]=states(aircraft.obj,time,"c","ecef")
norm(vel1_ine)-norm(vel2_ine) I am testing MATLAB satellite scenarios and coordinates frames. So I define a satellite scenario, and then I define a platform with a 0 velocity trajectory. Then I call the states function to get the position and velocity of the platform.
By default, the coordinate frame used by the states function is GCRF (inertial), therefore I would expect that my platform would have non-0 velocity and therefore a changing position due to the rotation of the Earth. On the other side, I would expect my platform to have 0 velocity and fixed position when I call states using ECEF coordinate frame, since it rotates along with the Earth, and any object on the surface of the Earth will be fixed in this coordinate system.
What I get when calling the states function is that positions behave as they should, that is, they are constant in the ECEF frame and variable in the GCRF (inertial) frame, but the velocities are weird. The velocities are non-0 (and are even variable) on ECEF coordinate system, and they are constant (non-0) on the GCRF (inertial) frame, which also doesn’t make sense because as the Earth rotates, the orientation of the velocity vector of my platform should change direction.
The funny thing is that when I call the states function specifying a datetime timeIn, the velocities do behave as they are supposed to, that is, they are 0 in the ECEF frame, and variable non-0 in the GCRF frame. This suggests that either there is something wrong in the implementation of the states function for platforms, or I’m doing something wrong in the definition of the platform and/or the call to the states function, so here is my code:
%% Satellite scenario parameters
mission.StartDate = datetime(2023,10,9,7,10,0,TimeZone="America/New_York");
mission.Duration = minutes(10);
mission.stopTime = mission.StartDate + mission.Duration;
sampleTime = 60; %seconds
mission.scenario = satelliteScenario(mission.StartDate,mission.stopTime,sampleTime);
%% Aircraft Trajectory
waypoints = [… % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;…
40.6289,-73.7738,3;…
];
timeOfArrival = duration([… % time (HH:mm:ss)
"00:00:00";…
"00:10:00"]);
geo_traj = geoTrajectory(waypoints,seconds(timeOfArrival));
aircraft.obj = platform(mission.scenario,geo_traj);
%% States
[pos_ine,vel_ine]=states(aircraft.obj) % Inertial, pos should be variable and vel should be variable (norm(vel) should be constant)
[pos_ecef,vel_ecef]=states(aircraft.obj,"c","ecef") % ECEF, pos should be constant, vel should be 0
% When specifying a time for evaluation, velocity behaves as expected
time = datetime(2023,10,9,7,11,0,TimeZone="America/New_York"); % t = 1 min
[~,vel1_ine]=states(aircraft.obj,time)
[~,vel1_ecef]=states(aircraft.obj,time,"c","ecef")
% vel2_ine should be different than vel1_ine, but norm(vel1_ine) should be equal to norm(vel2_ine)
% vel1_ecef and vel2_ecef should be 0
time = datetime(2023,10,9,7,19,0,TimeZone="America/New_York"); % t = 9 min
[~,vel2_ine]=states(aircraft.obj,time)
[~,vel2_ecef]=states(aircraft.obj,time,"c","ecef")
norm(vel1_ine)-norm(vel2_ine) satellite scenario, states, platform, coordinate frames, ecef, gcrf, reference frame MATLAB Answers — New Questions