How to perform access simultaneously for multiple groundstations?

8 views (last 30 days)
Hello,
I am trying to create an access table for multiple groundstations, but I've been getting this error:
"Error using access
Expected input number 2, OBJ2, to be a scalar.
Error in matlabshared.satellitescenario.internal.AddAssetsAndAnalyses.access
Error in matlabshared.satellitescenario.internal.PrimaryAsset/access"
Here is the code:
%Create Sat scenario
startTime = datetime(2021,6,02,8,23,0);
stopTime = startTime + hours(60);
sampleTime = 60;
sc = satelliteScenario(startTime,stopTime,sampleTime);
a = 800e3; e = 0; i = 96; raan = 100; aop = 90; ta = 0;
sat = satellite(sc,a_m,e,i,raan,aop,ta);
show(sat);
groundTrack(sat,"LeadTime",1200)
time = datetime(2021,6,02,12,30,0);
pos = states(sat,time,"CoordinateFrame","geographic");
%add ground stations
name = ["Svalbard, Norway","Tromso, Norway", "Inuvik,Canada",...
"Puertollano,Spain", "Athens,Greece","Los Angeles,USA",...
"Hartebeesthoek,S.Africa","Awarua,New Zealand","Punta Arenas,Chile",...
"Troll,Antartica", "Jeju, S.Korea"];
lat = [78.2, 69.6, 68.2,38.7,37.5,34.0,-25.8, -46.5,-53, -72.0,33.5];
lon = [15.3, 19.0,-133.3,-4,22.4,-118.3,27.7,168.4,-70, 2.5,126.8];
gs = groundStation(sc,"Name",name,"Latitude",lat, ...
"Longitude", lon);
And this is how I am doing the access:
ac = access(sat, gs);
intvls = accessIntervals(ac)
I would like something similar to the image attached, but showing other groundstations
  2 Comments
Daynah Rodriguez
Daynah Rodriguez on 3 Sep 2021
Is it something like this?
ac = access(sat,gs(1),gs(2),gs(3),gs(4),gs(5),gs(6),gs(7),gs(8),gs(9),gs(10),gs(11));
invls = accessIntervals(ac)
But then I get this
invls =
0×8 empty table
Daynah Rodriguez
Daynah Rodriguez on 3 Sep 2021
%% Access between sat and groundstations
ac1 = access(sat,gs(1)); ac2 = access(sat,gs(2)); ac3 = access(sat,gs(3));
ac4 = access(sat,gs(4)); ac5 = access(sat,gs(5)); ac6 = access(sat,gs(6));
ac7 = access(sat,gs(7)); ac8 = access(sat,gs(8)); ac9 = access(sat,gs(9));
ac10 = access(sat,gs(10)); ac11 = access(sat,gs(11));
%access output for each gs
accessIntervals(ac1), accessIntervals(ac2), accessIntervals(ac3),
accessIntervals(ac4), accessIntervals(ac5), accessIntervals(ac6),
accessIntervals(ac7), accessIntervals(ac8), accessIntervals(ac9),
accessIntervals(ac10), accessIntervals(ac11)

Sign in to comment.

Answers (1)

Aravind
Aravind on 18 Oct 2024
It seems you want to create a table of access intervals for the connections between a specific satellite and multiple ground stations. According to MathWorks documentation at https://www.mathworks.com/help/releases/R2021a/aerotbx/ug/satellitescenario.groundstation.access.html?s_tid=doc_ta#mw_a20f3494-4190-410d-85e5-cc869ea44649, the "access" function requires scalar objects of the "Satellite", "GroundStation", or "ConicalSensors" classes as inputs. The error you encountered arises because your code is passing a vector of "GroundStation" objects instead of individual ones.
To resolve this, you can use a "for" loop to iterate through each "GroundStation" object in your vector. For each ground station, create an access analysis object and compute the access intervals. Collect all the access intervals and aggregate them into a single table.
This approach should help you generate the desired table of access intervals for the satellite-ground station links.
I hope this clarifies your issue.

Categories

Find more on Satellite Mission Analysis in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!