This example demonstrates how to set up access analysis between a ground station and conical sensors onboard a constellation of satellites. A ground station and a conical sensor belonging to a satellite are said to have access to one another if the ground station is inside the conical sensor's field of view and the conical sensor's elevation angle with respect to the ground station is greater than or equal to the latter's minimum elevation angle. The scenario involves a constellation of 40 low-Earth orbit satellites and a geographical site, located at MathWorks Natick. Each satellite has a camera with a field of view of 90 degrees. The entire constellation of satellites is tasked with photographing MathWorks Natick, which is located at 42.3001 degrees North and 71.3504 degrees West. The photographs are required to be taken between 12 May 2020 1:00 PM UTC and 12 May 2020 7:00 PM UTC when MathWorks Natick is adequately illuminated by the sun. In order to capture good quality pictures with minimal atmospheric distortion, the satellite's elevation angle with respect to MathWorks Natick should be at least 30 degrees (please note that 30 degrees was arbitrarily chosen for illustrative purposes). During the 6 hour interval, it is required to determine the times during which each satellite can photograph MathWorks Natick. It is also required to determine the percentage of time during this interval when at least one satellite's camera can see MathWorks Natick. This percentage quantity is termed the system-wide access percentage.
Create a satellite scenario using
datetime to set the start time to 12-May-2020 1:00:00 PM UTC, and the stop time to 12-May-2020 7:00:00 PM UTC. Set the simulation sample time to 30 seconds.
startTime = datetime(2020,5,12,13,0,0); stopTime = startTime + hours(6); sampleTime = 30; % seconds sc = satelliteScenario(startTime,stopTime,sampleTime)
sc = satelliteScenario with properties: StartTime: 12-May-2020 13:00:00 StopTime: 12-May-2020 19:00:00 SampleTime: 30 Viewers: [0×0 matlabshared.satellitescenario.Viewer] Satellites:  GroundStations:  AutoShow: 1
satellite to add satellites to the scenario from the TLE file
leoSatelliteConstellation.tle. The TLE file defines the mean orbital parameters of 40 generic satellites in nearly circular low-Earth orbits at an altitude and inclination of approximately 500 km and 55 degrees respectively.
tleFile = "leoSatelliteConstellation.tle"; sat = satellite(sc,tleFile)
sat = 1×40 Satellite array with properties: Name ID ConicalSensors Gimbals Transmitters Receivers Accesses GroundTrack Orbit OrbitPropagator MarkerColor MarkerSize ShowLabel LabelFontColor LabelFontSize
conicalSensor to add a conical sensor to each satellite. These conical sensors represent the cameras. Specify their
MaxViewAngle to be 90 degrees, which defines the field of view.
for idx = 1:numel(sat) name = sat(idx).Name + " Camera"; conicalSensor(sat(idx),"Name",name,"MaxViewAngle",90); end % Retrieve the cameras cam = [sat.ConicalSensors]
cam = 1×40 ConicalSensor array with properties: Name ID MountingLocation MountingAngles MaxViewAngle Accesses FieldOfView
groundStation to add a ground station, which represents MathWorks Natick. Specify its
MinElevationAngle to be 30 degrees. If latitude and longitude are not specified, they default to the coordinates of MathWorks Natick.
name = "MathWorks Natick"; minElevationAngle = 30; % degrees mwNatick = groundStation(sc, ... "Name",name, ... "MinElevationAngle",minElevationAngle)
mwNatick = GroundStation with properties: Name: "MathWorks Natick" ID: 81 Latitude: 42.3001 Longitude: -71.3504 Altitude: 0 MinElevationAngle: 30 ConicalSensors:  Gimbals:  Transmitters:  Receivers:  Accesses:  MarkerColor: [0 1 1] MarkerSize: 10 ShowLabel: 1 LabelFontColor: [0 1 1] LabelFontSize: 15
access to add access analysis between each camera and MathWorks Natick. The access analyses will be used to determine when each camera can photograph MathWorks Natick.
for idx = 1:numel(cam) access(cam(idx),mwNatick); end % Retrieve the access analysis objects ac = [cam.Accesses]; % Properties of access analysis objects ac(1)
ans = Access with properties: Sequence: [41 81] LineWidth: 1 LineColor: [0.5000 0 1]
satelliteScenarioViewer to launch a satellite scenario viewer and visualize the scenario.
v = satelliteScenarioViewer(sc);
The viewer may be used as a visual confirmation that the scenario has been set up correctly. The violet line indicates that the camera on Satellite 4 and MathWorks Natick have access to one another. This means that MathWorks Natick is inside the camera's field of view and the camera's elevation angle with respect to MathWorks Natick is greater than or equal to 30 degrees. For the purposes of this scenario, this means that the camera can successfully photograph MathWorks Natick.
fieldOfView to visualize the field of view of each camera on Satellite 4.
fov = fieldOfView(cam([cam.Name] == "Satellite 4 Camera"))
fov = FieldOfView with properties: LineWidth: 1 LineColor: [0 1 0] VisibilityMode: 'inherit'
The presence of MathWorks Natick inside the contour is a visual confirmation that it is inside the field of view of the camera onboard Satellite 4.
hide to hide the satellite orbits and declutter the visualization.
Change the color of access visualizations to green.
for idx = 1:numel(ac) ac(idx).LineColor = 'green'; end
accessIntervals to determine the times when there is access between each camera and MathWorks Natick. These are the times when the camera can photograph MathWorks Natick
ans=30×8 table Source Target IntervalNumber StartTime EndTime Duration StartOrbit EndOrbit _____________________ __________________ ______________ ____________________ ____________________ ________ __________ ________ "Satellite 1 Camera" "MathWorks Natick" 1 12-May-2020 13:36:00 12-May-2020 13:39:30 210 1 1 "Satellite 1 Camera" "MathWorks Natick" 2 12-May-2020 15:23:00 12-May-2020 15:25:00 120 2 2 "Satellite 2 Camera" "MathWorks Natick" 1 12-May-2020 14:30:30 12-May-2020 14:34:30 240 1 1 "Satellite 3 Camera" "MathWorks Natick" 1 12-May-2020 13:28:30 12-May-2020 13:32:30 240 1 1 "Satellite 4 Camera" "MathWorks Natick" 1 12-May-2020 13:00:00 12-May-2020 13:02:30 150 1 1 "Satellite 4 Camera" "MathWorks Natick" 2 12-May-2020 14:46:00 12-May-2020 14:48:30 150 2 2 "Satellite 5 Camera" "MathWorks Natick" 1 12-May-2020 16:28:30 12-May-2020 16:33:00 270 3 3 "Satellite 6 Camera" "MathWorks Natick" 1 12-May-2020 17:05:30 12-May-2020 17:09:30 240 3 3 "Satellite 7 Camera" "MathWorks Natick" 1 12-May-2020 16:20:00 12-May-2020 16:24:30 270 2 3 "Satellite 8 Camera" "MathWorks Natick" 1 12-May-2020 15:18:00 12-May-2020 15:20:00 120 2 2 "Satellite 8 Camera" "MathWorks Natick" 2 12-May-2020 17:03:30 12-May-2020 17:07:00 210 3 3 "Satellite 9 Camera" "MathWorks Natick" 1 12-May-2020 17:55:30 12-May-2020 17:57:00 90 3 3 "Satellite 10 Camera" "MathWorks Natick" 1 12-May-2020 18:44:30 12-May-2020 18:49:00 270 4 4 "Satellite 11 Camera" "MathWorks Natick" 1 12-May-2020 18:39:30 12-May-2020 18:44:00 270 4 4 "Satellite 12 Camera" "MathWorks Natick" 1 12-May-2020 17:58:00 12-May-2020 18:01:00 180 3 3 "Satellite 29 Camera" "MathWorks Natick" 1 12-May-2020 13:09:30 12-May-2020 13:13:30 240 1 1 ⋮
The above table consists of the start and end times of each interval during which a given camera can photograph MathWorks Natick. The duration of each interval is reported in seconds. StartOrbit and EndOrbit are the orbit counts of the satellite that the camera is attached to when the access begins and ends. The count starts from the scenario start time.
play to visualize the simulation of the scenario from its start time to stop time. It can be seen that the green lines appear whenever the camera can photograph MathWorks Natick
In addition to determining the times when each camera can photograph MathWorks Natick, it is also required to determine the system-wide access percentage, which is the percentage of time from the scenario start time to stop time when at least one satellite can photograph MathWorks Natick. This is computed as follows:
For each camera, calculate the access status history to MathWorks Natick using
accessStatus. For a given camera, this is a row vector of logicals, where each element in the vector represents the access status corresponding to a given time sample. A value of
True indicates that the camera can photograph MathWorks Natick at that specific time sample.
Perform a logical
OR on all these row vectors corresponding to access of each camera to MathWorks Natick. This will result in a single row vector of logicals, in which a given element is true if at least one camera can photograph MathWorks Natick at the corresponding time sample for a duration of one scenario sample time of 30 seconds.
Count the number of elements in the vector whose value is
True. Multiply this quantity by the sample time of 30 seconds to determine the total time in seconds when at least one camera can photograph MathWorks Natick.
Divide this quantity by the scenario duration of 6 hours and multiply by 100 to get the system-wide access percentage.
for idx = 1:numel(ac) [s,time] = accessStatus(ac(idx)); if idx == 1 % Initialize system-wide access status vector in the first iteration systemWideAccessStatus = s; else % Update system-wide access status vector by performing a logical OR % with access status for the current camera-MathWorks Natick access % analysis systemWideAccessStatus = or(systemWideAccessStatus,s); end end
plot to plot the system-wide access status with respect to time.
plot(time,systemWideAccessStatus,"LineWidth",2); grid on; xlabel("Time"); ylabel("System-Wide Access Status");
Whenever system-wide access status is 1 (
True), at least one camera can photograph MathWorks Natick.
nnz to determine the number of elements in
systemWideAccessStatus whose value is
n = nnz(systemWideAccessStatus)
n = 203
Determine the total time when at least one camera can photograph MathWorks Natick. This is accomplished by multiplying the number of
True elements by the scenario's sample time.
systemWideAccessDuration = n*sc.SampleTime % seconds
systemWideAccessDuration = 6090
seconds to calculate the total scenario duration.
scenarioDuration = seconds(sc.StopTime - sc.StartTime)
scenarioDuration = 21600
Calculate the system-wide access percentage.
systemWideAccessPercentage = (systemWideAccessDuration/scenarioDuration)*100
systemWideAccessPercentage = 28.1944
The default attitude configuration of the satellites is such that their yaw axes point straight down towards nadir (the point on Earth directly below the satellite). Since the cameras are aligned with the yaw axis by default, they point straight down as well. As a result, MathWorks Natick goes outside the field of view of the cameras before their elevation angle dips below 30 degrees. Therefore, the system-wide access percentage is limited by the field of view of the cameras.
If instead the cameras always point at MathWorks Natick, the latter is always inside the cameras' field of view as long as the Earth is not blocking the line of sight. Consequently, the system-wide access percentage will now be limited by MathWorks Natick's
MinElevationAngle as opposed to the cameras' field of view. In the former case, the access intervals began and ended when MathWorks Natick entered and left the camera's field of view. It entered the field of view some time after the camera's elevation angle went above 30 degrees, and left the field of view before its elevation angle dipped below 30 degrees. However, if the cameras constantly point at MathWorks Natick, the access intervals will begin when the elevation angle rises above 30 degrees and end when it dips below 30 degrees, thereby increasing the duration of the intervals . Therefore, the system-wide access percentage will increase as well.
Since the cameras are rigidly attached to the satellites, each satellite is required to be continuously reoriented along its orbit so that its yaw axis tracks MathWorks Natick. As the cameras are aligned with the yaw axis, they too will point at MathWorks Natick. Use
pointAt to make each satellite's yaw axis track MathWorks Natick.
for idx = 1:numel(sat) pointAt(sat(idx),mwNatick); end
Re-calculate the system-wide access percentage.
% Calculate system-wide access status for idx = 1:numel(ac) [s,time] = accessStatus(ac(idx)); if idx == 1 % Initialize system-wide access status vector in the first iteration systemWideAccessStatus = s; else % Update system-wide access status vector by performing a logical OR % with access status for the current camera-MathWorks Natick % combination systemWideAccessStatus = or(systemWideAccessStatus,s); end end % Calculate system-wide access percentage n = nnz(systemWideAccessStatus); systemWideAccessDuration = n*sc.SampleTime; systemWideAccessPercentageWithTracking = (systemWideAccessDuration/scenarioDuration)*100
systemWideAccessPercentageWithTracking = 38.3333
The system-wide access percentage has improved by about 35%. This is the result of the cameras continuously pointing at MathWorks Natick. This can be visualized by using
The field of view contour is no longer circular because the camera is not pointing straight down anymore as it is tracking MathWorks Natick.
This example demonstrated how to determine the times at which cameras onboard satellites in a constellation can photograph a geographical site (MathWorks Natick). The cameras were modeled using conical sensors and access analysis was used to calculate the times. Additionally, system-wide access percentage was computed to determine the percentage of time during a 6 hour period when at least one satellite can photograph MathWorks Natick. It was seen that these results depended on which direction the cameras were pointing.
These results are also a function of:
Orbit of the satellites
MinElevationAngle of MathWorks Natick
Mounting position and location of the cameras with respect to the satellites
Field of view (
MaxViewAngle) of the cameras if they are not continuously pointing at MathWorks Natick
Modify the above parameters to your requirements and observe their influence on the access intervals and system-wide access percentage. The orbit of the satellites can be changed by explicitly specifying their Keplerian orbital elements using
satellite. Additionally, the cameras can be mounted on
gimbals, which can be rotated independent of the satellite. This way, the satellites can point straight down (the default behavior), while the gimbals can be configured so that the cameras independently track MathWorks Natick.