how can I add new property to a platform, Unrecognized property ‘Height’ for class ‘matlabshared.satellitescenario.Platform’.
%Load the Aircraft Trajectory
aircraft = load("aircraftTT.mat");
aircraft1 = load("aircraftTT1.mat");
aircraft2 = load("aircraftTT2.mat");
aircraft3 = load("aircraftTT3.mat");
aircraft4 = load("aircraftTT4.mat");
geoplot(aircraft.aircraftTT.AircraftLLA(:,1), aircraft.aircraftTT.AircraftLLA(:,2), "b–",…
aircraft1.aircraftTT1.AircraftLLA1(:,1), aircraft1.aircraftTT1.AircraftLLA1(:,2), "r–",…
aircraft2.aircraftTT2.AircraftLLA2(:,1), aircraft2.aircraftTT2.AircraftLLA2(:,2), "k–",…
aircraft3.aircraftTT3.AircraftLLA3(:,1), aircraft3.aircraftTT3.AircraftLLA3(:,2), "g–",…
aircraft4.aircraftTT4.AircraftLLA4(:,1), aircraft4.aircraftTT4.AircraftLLA4(:,2), "c–"…
)
title("Aircrafts Trajectories")
%legend(‘show’);
geobasemap streets
geolimits([38.0887 38.1099],[140.6330 140.6660])
%Load the Vehicles path
gx = geoaxes;
geolimits(gx,[38.0887,38.1099],[140.6330,140.6660]);
title("Vehicles Path")
geobasemap(gx,"streets");
useManualInput = true;
if useManualInput
waypoints = zeros(15,3); %#ok<*UNRCH>
numWaypoints = size(waypoints,1);
[lat,lon] = ginput(numWaypoints);
waypoints = [lat lon ones(numWaypoints,1)];
else
waypoints = […
42.265387594440746, -71.566584651695194, 1; …
42.263702708358274, -71.569614091115028, 1; …
42.262575723421115, -71.573098554161504, 1; …
42.260479485544565, -71.575579488911472, 1; …
42.258318030927740, -71.578013745650068, 1; …
42.256140084405871, -71.580417734892066, 1; …
42.253864954613888, -71.582655636609843, 1; …
42.251556291741792, -71.584827877421873, 1; …
42.249201618438420, -71.586910025508118, 1; …
42.246834381495290, -71.588965321234468, 1; …
42.244433745609328, -71.590949233154006, 1; …
42.242264173597064, -71.593357390593781, 1; …
42.240253137371795, -71.596002172990822, 1; …
42.238444180204169, -71.598914079082988, 1; …
42.236661606027504, -71.601851940116248, 1; …
42.235163293921218, -71.605069451220544, 1; …
42.233664981814933, -71.608286962324840, 1; …
42.232221634012099, -71.611549664950445, 1; …
42.230785995268782, -71.614818705946718, 1; …
42.229491349524331, -71.618178093198480, 1; …
42.228523450114722, -71.621746854731867, 1; …
42.227591252458026, -71.625329339092573, 1; …
42.227021657836168, -71.629051198649620, 1; …
42.226488781649429, -71.632774933477108, 1; …
42.226848543969822, -71.636544256810438, 1; …
42.227208306290223, -71.640313580143768, 1; …
42.227475917842995, -71.644096605079170, 1; …
42.227730436282329, -71.647881576787640, 1; …
42.227949419806208, -71.651670397035346, 1; …
42.228142838835581, -71.655461985995458, 1; …
42.228336257864946, -71.659253574955557, 1];
lat = waypoints(:,1);
lon = waypoints(:,2);
end
geoplot(gx,lat,lon,’r-‘)
title("Vehicles Path")
% Find the distance in statute miles between each waypoint
distInDeg = distance(waypoints(1:end-1,1:2),waypoints(2:end,1:2)); % deg
distInSM = deg2sm(distInDeg); % statute miles
carSpeed = 70 / 3600; % miles per second
timeOfArrival = [0; cumsum(distInSM) / carSpeed]; % seconds
carPath = geoTrajectory(waypoints,timeOfArrival);
%Define Mission Start Date and Duration"Creating the scenario"
mission.StartDate = datetime(2024,7,24,02,42,30,TimeZone="UTC");
mission.StopTime = mission.StartDate + hours(2) + minutes(2);
mission.Duration = hours(2); %should remove, I’ve already defined above
sampleTime = 10;
mission.scenario = satelliteScenario(mission.StartDate, mission.StopTime,sampleTime);
mission.viewer = satelliteScenarioViewer(mission.scenario);
%Add Vehicles to a Satellite Scenario
car = platform(mission.scenario,carPath, Name = "Car");
%Add Aircrafts to a Satellite Scenario
aircraft = platform(mission.scenario,aircraft.aircraftTT,Name="Aircraft1", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft);
aircraft1 = platform(mission.scenario,aircraft1.aircraftTT1,Name="Aircraft2", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft1);
aircraft2 = platform(mission.scenario,aircraft2.aircraftTT2,Name="Aircraft3", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft2);
aircraft3 = platform(mission.scenario,aircraft3.aircraftTT3,Name="Aircraft4", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft3);
aircraft4 = platform(mission.scenario,aircraft4.aircraftTT4,Name="Aircraft5", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft4);
%Add a Starlink Constellation to the Satellite Scenario-TLE files
sat = satellite(mission.scenario,"2024-001B.tle", Visual3DModel="SmallSat.glb");
show(sat)
groundTrack(sat,"LeadTime",1200);
%Aircraft-to-Vehicles Access Analysis
Preq = -35.5; % Required signal power in dBm
Ptx = 17.5; % Transmitted power in dBm
% Configure the ground station, satellites, and link characteristics
% Set the ground station characteristics with parabolic telescope
%gs = struct;
car.Height = 1; % Height above the mean sea level in km
car.OpticsEfficiency = 0.8; % Optical antenna efficiency
car.ApertureDiameter = 1; % Antenna aperture diameter in m
car.PointingError = 1e-6; % Pointing error in rad
% Set the satellite A characteristics with parabolic telescope
aircraft = struct;
aircraft.Height = 550; % Height above the mean sea level in km
aircraft.OpticsEfficiency = 0.8; % Optical antenna efficiency
aircraft.ApertureDiameter = 0.07; % Antenna aperture diameter in m
aircraft.PointingError = 1e-6; % Pointing error in rad
% Set the link characteristics
link = struct;
link.Wavelength = 1550e-9; % m
link.TroposphereHeight = 20; % km (Typically ranges from 6-20 km)
link.ElevationAngle = 50; % degrees
%link.Type = "downlink"; % "downlink"|"inter-satellite"|"uplink"
% When the Type field is set to "uplink" or "downlink", you must specify
% the CloudType field, as defined in [5] table 1
link.CloudType = "Thin cirrus";
tx = transmitter(car);
rx = receiver(aircraft,MountingAngles=[0; 180; 0]);
% Calculate transmitter and receiver gain
txGain = (pi*tx.ApertureDiameter/link.Wavelength)^2;
Gtx = 10*log10(txGain); % in dB
rxGain = (pi*rx.ApertureDiameter/link.Wavelength)^2;
Grx = 10*log10(rxGain); % in dB
% Calculate transmitter and receiver pointing loss in dB
txPointingLoss = 4.3429*(txGain*(tx.PointingError)^2);
rxPointingLoss = 4.3429*(rxGain*(rx.PointingError)^2);
absorptionLoss = 0.01; % Absorption loss in dB
% Calculate the distance of the optical beam that propagates through
% the troposphere layer of the atmosphere in km
dT = (link.TroposphereHeight – gs.Height).*cscd(link.ElevationAngle);
% Calculate the slant distance for uplink and downlink between
% satellite A and the ground station for circular orbit in m
dGS = slantRangeCircularOrbit(link.ElevationAngle,satA.Height*1e3,gs.Height*1e3);
% Calculate free-space path loss between the ground station and
% satellite in dB
pathLoss = fspl(dGS,link.Wavelength);
% Calculate loss due to geometrical scattering
% cnc – cloud number concentration in cm-3
% lwc – Liquid water content in g/m-3
[cnc,lwc] = getCloudParameters(link.CloudType);
visibility = 1.002/((lwc*cnc)^0.6473); % Calculate visibility in km
% Get particle size related coefficient
if visibility<=0.5
delta = 0;
elseif visibility>0.5 && visibility<=1
delta = visibility – 0.5;
elseif visibility>1 && visibility<=6
delta = 0.16*visibility + 0.34;
elseif visibility>=6 && visibility<=50
delta = 1.3;
else % visibility>50
delta = 1.6;
end
geoCoeff = (3.91/visibility)* …
((link.Wavelength*1e9/550)^-delta); % Extinction coefficient
geoScaLoss = 4.3429*geoCoeff*dT; % Geometrical scattering loss in dB
% Calculate loss due to Mie scattering
lambda_mu = link.Wavelength*1e6; % Wavelength in microns
% Calculate empirical coefficients
a = (0.000487*(lambda_mu^3)) – (0.002237*(lambda_mu^2)) + …
(0.003864*lambda_mu) – 0.004442;
b = (-0.00573*(lambda_mu^3)) + (0.02639*(lambda_mu^2)) – …
(0.04552*lambda_mu) + 0.05164;
c = (0.02565*(lambda_mu^3)) – (0.1191*(lambda_mu^2)) + …
(0.20385*lambda_mu) – 0.216;
d = (-0.0638*(lambda_mu^3)) + (0.3034*(lambda_mu^2)) – …
(0.5083*lambda_mu) + 0.425;
mieER = a*(gs.Height^3) + b*(gs.Height^2) + …
c*(gs.Height) + d; % Extinction ratio
mieScaLoss = (4.3429*mieER)./sind(link.ElevationAngle); % Mie scattering loss in dB
% Calculate link margin for uplink or downlink in dB
linkMargin = Ptx + 10*log10(tx.OpticsEfficiency) + …
10*log10(rx.OpticsEfficiency) + Gtx + Grx – …
txPointingLoss – rxPointingLoss – pathLoss – …
absorptionLoss – geoScaLoss – mieScaLoss – Preq;
disp("Link margin for "+num2str(link.Type)+" is "+num2str(linkMargin)+" dB")%Load the Aircraft Trajectory
aircraft = load("aircraftTT.mat");
aircraft1 = load("aircraftTT1.mat");
aircraft2 = load("aircraftTT2.mat");
aircraft3 = load("aircraftTT3.mat");
aircraft4 = load("aircraftTT4.mat");
geoplot(aircraft.aircraftTT.AircraftLLA(:,1), aircraft.aircraftTT.AircraftLLA(:,2), "b–",…
aircraft1.aircraftTT1.AircraftLLA1(:,1), aircraft1.aircraftTT1.AircraftLLA1(:,2), "r–",…
aircraft2.aircraftTT2.AircraftLLA2(:,1), aircraft2.aircraftTT2.AircraftLLA2(:,2), "k–",…
aircraft3.aircraftTT3.AircraftLLA3(:,1), aircraft3.aircraftTT3.AircraftLLA3(:,2), "g–",…
aircraft4.aircraftTT4.AircraftLLA4(:,1), aircraft4.aircraftTT4.AircraftLLA4(:,2), "c–"…
)
title("Aircrafts Trajectories")
%legend(‘show’);
geobasemap streets
geolimits([38.0887 38.1099],[140.6330 140.6660])
%Load the Vehicles path
gx = geoaxes;
geolimits(gx,[38.0887,38.1099],[140.6330,140.6660]);
title("Vehicles Path")
geobasemap(gx,"streets");
useManualInput = true;
if useManualInput
waypoints = zeros(15,3); %#ok<*UNRCH>
numWaypoints = size(waypoints,1);
[lat,lon] = ginput(numWaypoints);
waypoints = [lat lon ones(numWaypoints,1)];
else
waypoints = […
42.265387594440746, -71.566584651695194, 1; …
42.263702708358274, -71.569614091115028, 1; …
42.262575723421115, -71.573098554161504, 1; …
42.260479485544565, -71.575579488911472, 1; …
42.258318030927740, -71.578013745650068, 1; …
42.256140084405871, -71.580417734892066, 1; …
42.253864954613888, -71.582655636609843, 1; …
42.251556291741792, -71.584827877421873, 1; …
42.249201618438420, -71.586910025508118, 1; …
42.246834381495290, -71.588965321234468, 1; …
42.244433745609328, -71.590949233154006, 1; …
42.242264173597064, -71.593357390593781, 1; …
42.240253137371795, -71.596002172990822, 1; …
42.238444180204169, -71.598914079082988, 1; …
42.236661606027504, -71.601851940116248, 1; …
42.235163293921218, -71.605069451220544, 1; …
42.233664981814933, -71.608286962324840, 1; …
42.232221634012099, -71.611549664950445, 1; …
42.230785995268782, -71.614818705946718, 1; …
42.229491349524331, -71.618178093198480, 1; …
42.228523450114722, -71.621746854731867, 1; …
42.227591252458026, -71.625329339092573, 1; …
42.227021657836168, -71.629051198649620, 1; …
42.226488781649429, -71.632774933477108, 1; …
42.226848543969822, -71.636544256810438, 1; …
42.227208306290223, -71.640313580143768, 1; …
42.227475917842995, -71.644096605079170, 1; …
42.227730436282329, -71.647881576787640, 1; …
42.227949419806208, -71.651670397035346, 1; …
42.228142838835581, -71.655461985995458, 1; …
42.228336257864946, -71.659253574955557, 1];
lat = waypoints(:,1);
lon = waypoints(:,2);
end
geoplot(gx,lat,lon,’r-‘)
title("Vehicles Path")
% Find the distance in statute miles between each waypoint
distInDeg = distance(waypoints(1:end-1,1:2),waypoints(2:end,1:2)); % deg
distInSM = deg2sm(distInDeg); % statute miles
carSpeed = 70 / 3600; % miles per second
timeOfArrival = [0; cumsum(distInSM) / carSpeed]; % seconds
carPath = geoTrajectory(waypoints,timeOfArrival);
%Define Mission Start Date and Duration"Creating the scenario"
mission.StartDate = datetime(2024,7,24,02,42,30,TimeZone="UTC");
mission.StopTime = mission.StartDate + hours(2) + minutes(2);
mission.Duration = hours(2); %should remove, I’ve already defined above
sampleTime = 10;
mission.scenario = satelliteScenario(mission.StartDate, mission.StopTime,sampleTime);
mission.viewer = satelliteScenarioViewer(mission.scenario);
%Add Vehicles to a Satellite Scenario
car = platform(mission.scenario,carPath, Name = "Car");
%Add Aircrafts to a Satellite Scenario
aircraft = platform(mission.scenario,aircraft.aircraftTT,Name="Aircraft1", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft);
aircraft1 = platform(mission.scenario,aircraft1.aircraftTT1,Name="Aircraft2", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft1);
aircraft2 = platform(mission.scenario,aircraft2.aircraftTT2,Name="Aircraft3", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft2);
aircraft3 = platform(mission.scenario,aircraft3.aircraftTT3,Name="Aircraft4", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft3);
aircraft4 = platform(mission.scenario,aircraft4.aircraftTT4,Name="Aircraft5", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft4);
%Add a Starlink Constellation to the Satellite Scenario-TLE files
sat = satellite(mission.scenario,"2024-001B.tle", Visual3DModel="SmallSat.glb");
show(sat)
groundTrack(sat,"LeadTime",1200);
%Aircraft-to-Vehicles Access Analysis
Preq = -35.5; % Required signal power in dBm
Ptx = 17.5; % Transmitted power in dBm
% Configure the ground station, satellites, and link characteristics
% Set the ground station characteristics with parabolic telescope
%gs = struct;
car.Height = 1; % Height above the mean sea level in km
car.OpticsEfficiency = 0.8; % Optical antenna efficiency
car.ApertureDiameter = 1; % Antenna aperture diameter in m
car.PointingError = 1e-6; % Pointing error in rad
% Set the satellite A characteristics with parabolic telescope
aircraft = struct;
aircraft.Height = 550; % Height above the mean sea level in km
aircraft.OpticsEfficiency = 0.8; % Optical antenna efficiency
aircraft.ApertureDiameter = 0.07; % Antenna aperture diameter in m
aircraft.PointingError = 1e-6; % Pointing error in rad
% Set the link characteristics
link = struct;
link.Wavelength = 1550e-9; % m
link.TroposphereHeight = 20; % km (Typically ranges from 6-20 km)
link.ElevationAngle = 50; % degrees
%link.Type = "downlink"; % "downlink"|"inter-satellite"|"uplink"
% When the Type field is set to "uplink" or "downlink", you must specify
% the CloudType field, as defined in [5] table 1
link.CloudType = "Thin cirrus";
tx = transmitter(car);
rx = receiver(aircraft,MountingAngles=[0; 180; 0]);
% Calculate transmitter and receiver gain
txGain = (pi*tx.ApertureDiameter/link.Wavelength)^2;
Gtx = 10*log10(txGain); % in dB
rxGain = (pi*rx.ApertureDiameter/link.Wavelength)^2;
Grx = 10*log10(rxGain); % in dB
% Calculate transmitter and receiver pointing loss in dB
txPointingLoss = 4.3429*(txGain*(tx.PointingError)^2);
rxPointingLoss = 4.3429*(rxGain*(rx.PointingError)^2);
absorptionLoss = 0.01; % Absorption loss in dB
% Calculate the distance of the optical beam that propagates through
% the troposphere layer of the atmosphere in km
dT = (link.TroposphereHeight – gs.Height).*cscd(link.ElevationAngle);
% Calculate the slant distance for uplink and downlink between
% satellite A and the ground station for circular orbit in m
dGS = slantRangeCircularOrbit(link.ElevationAngle,satA.Height*1e3,gs.Height*1e3);
% Calculate free-space path loss between the ground station and
% satellite in dB
pathLoss = fspl(dGS,link.Wavelength);
% Calculate loss due to geometrical scattering
% cnc – cloud number concentration in cm-3
% lwc – Liquid water content in g/m-3
[cnc,lwc] = getCloudParameters(link.CloudType);
visibility = 1.002/((lwc*cnc)^0.6473); % Calculate visibility in km
% Get particle size related coefficient
if visibility<=0.5
delta = 0;
elseif visibility>0.5 && visibility<=1
delta = visibility – 0.5;
elseif visibility>1 && visibility<=6
delta = 0.16*visibility + 0.34;
elseif visibility>=6 && visibility<=50
delta = 1.3;
else % visibility>50
delta = 1.6;
end
geoCoeff = (3.91/visibility)* …
((link.Wavelength*1e9/550)^-delta); % Extinction coefficient
geoScaLoss = 4.3429*geoCoeff*dT; % Geometrical scattering loss in dB
% Calculate loss due to Mie scattering
lambda_mu = link.Wavelength*1e6; % Wavelength in microns
% Calculate empirical coefficients
a = (0.000487*(lambda_mu^3)) – (0.002237*(lambda_mu^2)) + …
(0.003864*lambda_mu) – 0.004442;
b = (-0.00573*(lambda_mu^3)) + (0.02639*(lambda_mu^2)) – …
(0.04552*lambda_mu) + 0.05164;
c = (0.02565*(lambda_mu^3)) – (0.1191*(lambda_mu^2)) + …
(0.20385*lambda_mu) – 0.216;
d = (-0.0638*(lambda_mu^3)) + (0.3034*(lambda_mu^2)) – …
(0.5083*lambda_mu) + 0.425;
mieER = a*(gs.Height^3) + b*(gs.Height^2) + …
c*(gs.Height) + d; % Extinction ratio
mieScaLoss = (4.3429*mieER)./sind(link.ElevationAngle); % Mie scattering loss in dB
% Calculate link margin for uplink or downlink in dB
linkMargin = Ptx + 10*log10(tx.OpticsEfficiency) + …
10*log10(rx.OpticsEfficiency) + Gtx + Grx – …
txPointingLoss – rxPointingLoss – pathLoss – …
absorptionLoss – geoScaLoss – mieScaLoss – Preq;
disp("Link margin for "+num2str(link.Type)+" is "+num2str(linkMargin)+" dB") %Load the Aircraft Trajectory
aircraft = load("aircraftTT.mat");
aircraft1 = load("aircraftTT1.mat");
aircraft2 = load("aircraftTT2.mat");
aircraft3 = load("aircraftTT3.mat");
aircraft4 = load("aircraftTT4.mat");
geoplot(aircraft.aircraftTT.AircraftLLA(:,1), aircraft.aircraftTT.AircraftLLA(:,2), "b–",…
aircraft1.aircraftTT1.AircraftLLA1(:,1), aircraft1.aircraftTT1.AircraftLLA1(:,2), "r–",…
aircraft2.aircraftTT2.AircraftLLA2(:,1), aircraft2.aircraftTT2.AircraftLLA2(:,2), "k–",…
aircraft3.aircraftTT3.AircraftLLA3(:,1), aircraft3.aircraftTT3.AircraftLLA3(:,2), "g–",…
aircraft4.aircraftTT4.AircraftLLA4(:,1), aircraft4.aircraftTT4.AircraftLLA4(:,2), "c–"…
)
title("Aircrafts Trajectories")
%legend(‘show’);
geobasemap streets
geolimits([38.0887 38.1099],[140.6330 140.6660])
%Load the Vehicles path
gx = geoaxes;
geolimits(gx,[38.0887,38.1099],[140.6330,140.6660]);
title("Vehicles Path")
geobasemap(gx,"streets");
useManualInput = true;
if useManualInput
waypoints = zeros(15,3); %#ok<*UNRCH>
numWaypoints = size(waypoints,1);
[lat,lon] = ginput(numWaypoints);
waypoints = [lat lon ones(numWaypoints,1)];
else
waypoints = […
42.265387594440746, -71.566584651695194, 1; …
42.263702708358274, -71.569614091115028, 1; …
42.262575723421115, -71.573098554161504, 1; …
42.260479485544565, -71.575579488911472, 1; …
42.258318030927740, -71.578013745650068, 1; …
42.256140084405871, -71.580417734892066, 1; …
42.253864954613888, -71.582655636609843, 1; …
42.251556291741792, -71.584827877421873, 1; …
42.249201618438420, -71.586910025508118, 1; …
42.246834381495290, -71.588965321234468, 1; …
42.244433745609328, -71.590949233154006, 1; …
42.242264173597064, -71.593357390593781, 1; …
42.240253137371795, -71.596002172990822, 1; …
42.238444180204169, -71.598914079082988, 1; …
42.236661606027504, -71.601851940116248, 1; …
42.235163293921218, -71.605069451220544, 1; …
42.233664981814933, -71.608286962324840, 1; …
42.232221634012099, -71.611549664950445, 1; …
42.230785995268782, -71.614818705946718, 1; …
42.229491349524331, -71.618178093198480, 1; …
42.228523450114722, -71.621746854731867, 1; …
42.227591252458026, -71.625329339092573, 1; …
42.227021657836168, -71.629051198649620, 1; …
42.226488781649429, -71.632774933477108, 1; …
42.226848543969822, -71.636544256810438, 1; …
42.227208306290223, -71.640313580143768, 1; …
42.227475917842995, -71.644096605079170, 1; …
42.227730436282329, -71.647881576787640, 1; …
42.227949419806208, -71.651670397035346, 1; …
42.228142838835581, -71.655461985995458, 1; …
42.228336257864946, -71.659253574955557, 1];
lat = waypoints(:,1);
lon = waypoints(:,2);
end
geoplot(gx,lat,lon,’r-‘)
title("Vehicles Path")
% Find the distance in statute miles between each waypoint
distInDeg = distance(waypoints(1:end-1,1:2),waypoints(2:end,1:2)); % deg
distInSM = deg2sm(distInDeg); % statute miles
carSpeed = 70 / 3600; % miles per second
timeOfArrival = [0; cumsum(distInSM) / carSpeed]; % seconds
carPath = geoTrajectory(waypoints,timeOfArrival);
%Define Mission Start Date and Duration"Creating the scenario"
mission.StartDate = datetime(2024,7,24,02,42,30,TimeZone="UTC");
mission.StopTime = mission.StartDate + hours(2) + minutes(2);
mission.Duration = hours(2); %should remove, I’ve already defined above
sampleTime = 10;
mission.scenario = satelliteScenario(mission.StartDate, mission.StopTime,sampleTime);
mission.viewer = satelliteScenarioViewer(mission.scenario);
%Add Vehicles to a Satellite Scenario
car = platform(mission.scenario,carPath, Name = "Car");
%Add Aircrafts to a Satellite Scenario
aircraft = platform(mission.scenario,aircraft.aircraftTT,Name="Aircraft1", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft);
aircraft1 = platform(mission.scenario,aircraft1.aircraftTT1,Name="Aircraft2", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft1);
aircraft2 = platform(mission.scenario,aircraft2.aircraftTT2,Name="Aircraft3", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft2);
aircraft3 = platform(mission.scenario,aircraft3.aircraftTT3,Name="Aircraft4", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft3);
aircraft4 = platform(mission.scenario,aircraft4.aircraftTT4,Name="Aircraft5", Visual3DModel="NarrowBodyAirliner.glb")
%camtarget(mission.viewer,aircraft4);
%Add a Starlink Constellation to the Satellite Scenario-TLE files
sat = satellite(mission.scenario,"2024-001B.tle", Visual3DModel="SmallSat.glb");
show(sat)
groundTrack(sat,"LeadTime",1200);
%Aircraft-to-Vehicles Access Analysis
Preq = -35.5; % Required signal power in dBm
Ptx = 17.5; % Transmitted power in dBm
% Configure the ground station, satellites, and link characteristics
% Set the ground station characteristics with parabolic telescope
%gs = struct;
car.Height = 1; % Height above the mean sea level in km
car.OpticsEfficiency = 0.8; % Optical antenna efficiency
car.ApertureDiameter = 1; % Antenna aperture diameter in m
car.PointingError = 1e-6; % Pointing error in rad
% Set the satellite A characteristics with parabolic telescope
aircraft = struct;
aircraft.Height = 550; % Height above the mean sea level in km
aircraft.OpticsEfficiency = 0.8; % Optical antenna efficiency
aircraft.ApertureDiameter = 0.07; % Antenna aperture diameter in m
aircraft.PointingError = 1e-6; % Pointing error in rad
% Set the link characteristics
link = struct;
link.Wavelength = 1550e-9; % m
link.TroposphereHeight = 20; % km (Typically ranges from 6-20 km)
link.ElevationAngle = 50; % degrees
%link.Type = "downlink"; % "downlink"|"inter-satellite"|"uplink"
% When the Type field is set to "uplink" or "downlink", you must specify
% the CloudType field, as defined in [5] table 1
link.CloudType = "Thin cirrus";
tx = transmitter(car);
rx = receiver(aircraft,MountingAngles=[0; 180; 0]);
% Calculate transmitter and receiver gain
txGain = (pi*tx.ApertureDiameter/link.Wavelength)^2;
Gtx = 10*log10(txGain); % in dB
rxGain = (pi*rx.ApertureDiameter/link.Wavelength)^2;
Grx = 10*log10(rxGain); % in dB
% Calculate transmitter and receiver pointing loss in dB
txPointingLoss = 4.3429*(txGain*(tx.PointingError)^2);
rxPointingLoss = 4.3429*(rxGain*(rx.PointingError)^2);
absorptionLoss = 0.01; % Absorption loss in dB
% Calculate the distance of the optical beam that propagates through
% the troposphere layer of the atmosphere in km
dT = (link.TroposphereHeight – gs.Height).*cscd(link.ElevationAngle);
% Calculate the slant distance for uplink and downlink between
% satellite A and the ground station for circular orbit in m
dGS = slantRangeCircularOrbit(link.ElevationAngle,satA.Height*1e3,gs.Height*1e3);
% Calculate free-space path loss between the ground station and
% satellite in dB
pathLoss = fspl(dGS,link.Wavelength);
% Calculate loss due to geometrical scattering
% cnc – cloud number concentration in cm-3
% lwc – Liquid water content in g/m-3
[cnc,lwc] = getCloudParameters(link.CloudType);
visibility = 1.002/((lwc*cnc)^0.6473); % Calculate visibility in km
% Get particle size related coefficient
if visibility<=0.5
delta = 0;
elseif visibility>0.5 && visibility<=1
delta = visibility – 0.5;
elseif visibility>1 && visibility<=6
delta = 0.16*visibility + 0.34;
elseif visibility>=6 && visibility<=50
delta = 1.3;
else % visibility>50
delta = 1.6;
end
geoCoeff = (3.91/visibility)* …
((link.Wavelength*1e9/550)^-delta); % Extinction coefficient
geoScaLoss = 4.3429*geoCoeff*dT; % Geometrical scattering loss in dB
% Calculate loss due to Mie scattering
lambda_mu = link.Wavelength*1e6; % Wavelength in microns
% Calculate empirical coefficients
a = (0.000487*(lambda_mu^3)) – (0.002237*(lambda_mu^2)) + …
(0.003864*lambda_mu) – 0.004442;
b = (-0.00573*(lambda_mu^3)) + (0.02639*(lambda_mu^2)) – …
(0.04552*lambda_mu) + 0.05164;
c = (0.02565*(lambda_mu^3)) – (0.1191*(lambda_mu^2)) + …
(0.20385*lambda_mu) – 0.216;
d = (-0.0638*(lambda_mu^3)) + (0.3034*(lambda_mu^2)) – …
(0.5083*lambda_mu) + 0.425;
mieER = a*(gs.Height^3) + b*(gs.Height^2) + …
c*(gs.Height) + d; % Extinction ratio
mieScaLoss = (4.3429*mieER)./sind(link.ElevationAngle); % Mie scattering loss in dB
% Calculate link margin for uplink or downlink in dB
linkMargin = Ptx + 10*log10(tx.OpticsEfficiency) + …
10*log10(rx.OpticsEfficiency) + Gtx + Grx – …
txPointingLoss – rxPointingLoss – pathLoss – …
absorptionLoss – geoScaLoss – mieScaLoss – Preq;
disp("Link margin for "+num2str(link.Type)+" is "+num2str(linkMargin)+" dB") satellite, car MATLAB Answers — New Questions