limit elevation angles for a phased array on a platform/aircraft to satellite
조회 수: 13 (최근 30일)
이전 댓글 표시
I am able to run and modify this example: Aircraft-to-Satellite Communication for ADS-B Out - MATLAB & Simulink (mathworks.com)
except I do not know how to limit the elevation angles to the satellite such as can be done with a ground station very easily as in the ground station code below:
% Create a satellite scenario with AutoSimulate set to false
sc = satelliteScenario('AutoSimulate', false);
% Define the satellite with a higher orbit
semiMajorAxis = 7000e3; % Semi-major axis in meters (higher orbit)
eccentricity = 0.001; % Eccentricity
inclination = 90; % Inclination in degrees (adjusted for closer pass)
rightAscension = 164.5; % 105 Right ascension of the ascending node in degrees (adjusted for longitude)
argumentOfPeriapsis = 0; % Argument of periapsis in degrees
trueAnomaly = 0; % True anomaly in degrees
sat = satellite(sc, semiMajorAxis, eccentricity, inclination, ...
rightAscension, argumentOfPeriapsis, trueAnomaly);
% Set the elevation range
minElevation = 37; % Minimum elevation in degrees
maxElevation = 90; % Maximum elevation in degrees
% Define the ground station (representing the aircraft)
gs = groundStation(sc, 'Name', 'MyAircraft', 'Latitude', 40.0150,...
'Longitude', -105.2705, 'Altitude', 10000, 'MinElevationAngle',minElevation);
It is a built in property of the grounStation function. How can I use the above example, but limit the elevation angles like in the groundStation property?
This is some of the aircraft code:
waypoints = [... % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;...
40.6325,-73.7819,3;...
40.6341,-73.7852,44;...
40.6400,-73.7974,265;...
40.6171,-73.8618,1012;...
40.5787,-73.8585,1698;...
39.1452,-71.6083,11270;...
34.2281,-66.0839,11264;...
32.4248,-64.4389,970;...
32.3476,-64.4565,574;...
32.3320,-64.4915,452;...
32.3459,-64.5712,453;...
32.3610,-64.6612,18;...
32.3621,-64.6678,3;...
32.3639,-64.6777,3];
timeOfArrival = duration([... % time (HH:mm:ss)
"00:00:00";...
"00:00:20";...
"00:00:27";...
"00:00:43";...
"00:01:47";...
"00:02:21";...
"00:21:25";...
"01:32:39";...
"01:54:27";...
"01:55:47";...
"01:56:27";...
"01:57:48";...
"01:59:49";...
"01:59:55";...
"02:00:15"]);
trajectory = geoTrajectory(waypoints,seconds(timeOfArrival),'SampleRate',sampleTime,...
'SamplesPerFrame', 10, AutoPitch=true,AutoBank=true);
minElevationAngle = 30; % degrees
aircraft = platform(sc,trajectory, Name="Aircraft", Visual3DModel="airplane.glb");
The limits I want to impose on the simulation and viewing are from elevation = 90 to 30.
Thank you for the help
댓글 수: 0
답변 (1개)
Shishir Reddy
2024년 8월 28일
편집: Shishir Reddy
2024년 8월 28일
Hey Mike
Ground stations have fixed locations on Earth. This makes the calculation of elevation angles relatively straightforward since the ground station's position doesn't change over time.
Unlike a ground station, an aircraft moves along a trajectory. This dynamic movement means the position relative to a satellite changes continuously, requiring real-time calculation of elevation angles throughout the simulation.
The elevation angle can be calculated based on the positions of aircraft and satellite as follows.
function elevationAngle = calculateElevationAngle(aircraftPos, satPos)
[lat1, lon1, alt1] = aircraftPos;
[lat2, lon2, alt2] = satPos;
lat1 = deg2rad(lat1);
lon1 = deg2rad(lon1);
lat2 = deg2rad(lat2);
lon2 = deg2rad(lon2);
dLat = lat2 - lat1;
dLon = lon2 - lon1;
a = sin(dLat/2)^2 + cos(lat1) * cos(lat2) * sin(dLon/2)^2;
% This is a simplified calculation for spherical Earth
c = 2 * atan2(sqrt(a), sqrt(1-a));
distance = 6371000 * c; % Earth radius
elevationAngle = atan2((alt2 - alt1), distance);
elevationAngle = rad2deg(elevationAngle);
end
Using the above script which computes the elevation angle, the restrictions can be imposed by using simple ‘if’ statement as follows.
minElevationAngle = 30;
maxElevationAngle = 90;
for t = 1:length(timeOfArrival)
elevationAngle = calculateElevationAngle(aircraftPos, satPos);
if elevationAngle < minElevationAngle || elevationAngle > maxElevationAngle
% aircraftPos, satPos are positions at time t.
fprintf('Invalid elevation angle at time %s: %f degrees\n', timeOfArrival(t), elevationAngle);
break;
end
end
I hope this helps.
참고 항목
카테고리
Help Center 및 File Exchange에서 Reference Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!