Error while running NR Intercell Interference Model
Dear All,
Thanks in advance. Do I need to include any package?
==================code
wirelessnetworkSupportPackageCheck
rng("default") % Reset the random number generator
numFrameSimulation = 20; % Simulation time in terms of number of 10 ms frames
networkSimulator = wirelessNetworkSimulator.init;
gNBPositions = [1700 600 30; 3000 600 30; 2500 2000 30];
gNBOfInterestIdx = 3; % Specify an integer value in the range [1, number of gNBs]
gNBNames = "gNB-" + (1:size(gNBPositions,1));
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …
ChannelBandwidth=10e6,SubcarrierSpacing=30e3,TransmitPower=32,ReceiveGain=11);
for gNBIdx = 1:length(gNBs)
% Resource allocation type value 0 indicates a noncontiguous allocation of
% frequency-domain resources in terms of RBGs
configureScheduler(gNBs(gNBIdx),ResourceAllocationType=0)
end
numCells = length(gNBs);
cellRadius = 500; % Radius of each cell (in meters)
numUEsPerCell = 4;
uePositions = generateUEPositions(cellRadius,gNBPositions,numUEsPerCell);
UEs = cell(numCells,1);
for cellIdx = 1:numCells
ueNames = "UE-" + (1:size(uePositions{cellIdx},1));
UEs{cellIdx} = nrUE(Name=ueNames,Position=uePositions{cellIdx},ReceiveGain=11);
connectUE(gNBs(cellIdx),UEs{cellIdx},FullBufferTraffic="DL")
end
addNodes(networkSimulator,gNBs);
for cellIdx = 1:numCells
addNodes(networkSimulator,UEs{cellIdx})
end
channelModel = "3GPP TR 38.901";
if strcmp(channelModel,"3GPP TR 38.901")
% Define scenario boundaries
pos = [reshape([gNBs.Position],3,[])];
minX = min(pos(1,:)); % x-coordinate of the left edge of the scenario in meters
minY = min(pos(2,:)); % y-coordinate of the bottom edge of the scenario in meters
width = max(pos(1,:)) – minX; % Width (right edge of the 2D scenario) in meters, given as maxX – minX
height = max(pos(2,:)) – minY; % Height (top edge of the 2D scenario) in meters, given as maxY – minY
% Create the channel model
channel = h38901Channel(Scenario="UMa",ScenarioExtents=[minX minY width height]);
% Add the channel model to the simulator
addChannelModel(networkSimulator,@channel.channelFunction);
connectNodes(channel,networkSimulator,InterfererHasSmallScale=true);
end
cellToAnalyze = gNBs(gNBOfInterestIdx).ID;
enableTraces = true;
linkDir = 0; % Indicates DL
if enableTraces
simSchedulingLogger = cell(numCells,1);
simPhyLogger = cell(numCells,1);
for cellIdx = 1:numCells
% Create an object for MAC DL scheduling traces logging
simSchedulingLogger{cellIdx} = helperNRSchedulingLogger(numFrameSimulation, …
gNBs(cellToAnalyze),UEs{cellToAnalyze},LinkDirection=linkDir);
% Create an object for PHY layer traces logging
simPhyLogger{cellIdx} = helperNRPhyLogger(numFrameSimulation,gNBs(cellToAnalyze), …
UEs{cellToAnalyze});
end
end
numMetricPlotUpdates = numFrameSimulation;
showSchedulerMetrics = true;
showPhyMetrics = true;
metricsVisualizer = helperNRMetricsVisualizer(gNBs(cellToAnalyze),UEs{cellToAnalyze}, …
CellOfInterest=cellToAnalyze,NumMetricsSteps=numMetricPlotUpdates, …
PlotSchedulerMetrics=showSchedulerMetrics,PlotPhyMetrics=showPhyMetrics,LinkDirection=linkDir);
simulationLogFile = "simulationLogs"; % For logging the simulation traces
enableMobility = false;
if enableMobility
ueSpeedRange = [1 1000]; % In meters per second
ueWithMobility = UEs{cellToAnalyze}(2); % Get UE-2 in the cell of interest
% Add random waypoint mobility to the selected UE
addMobility(ueWithMobility,SpeedRange=ueSpeedRange,BoundaryShape="circle",Bounds=[gNBs(cellToAnalyze).Position(1:2) cellRadius])
end
networkVisualizer = helperNetworkVisualizer(SampleRate=100); % Sample rate indicates the visualization refresh rate in Hertz
% Show the cell boundary of each gNB
showBoundaries(networkVisualizer,gNBPositions,cellRadius,cellToAnalyze)
% Calculate the simulation duration (in seconds)
simulationTime = numFrameSimulation*1e-2;
% Run the simulation
run(networkSimulator,simulationTime);
========================================================code
Error=====================================================
>> test001
Error using nrGNB/getMCSTable (line 1331)
Invalid default value for property ‘MCSTable’ in class ‘nrGNB’:
Unable to resolve the name ‘nr5g.internal.MACConstants.MCSTable’.
Error in test001 (line 8)
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …Dear All,
Thanks in advance. Do I need to include any package?
==================code
wirelessnetworkSupportPackageCheck
rng("default") % Reset the random number generator
numFrameSimulation = 20; % Simulation time in terms of number of 10 ms frames
networkSimulator = wirelessNetworkSimulator.init;
gNBPositions = [1700 600 30; 3000 600 30; 2500 2000 30];
gNBOfInterestIdx = 3; % Specify an integer value in the range [1, number of gNBs]
gNBNames = "gNB-" + (1:size(gNBPositions,1));
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …
ChannelBandwidth=10e6,SubcarrierSpacing=30e3,TransmitPower=32,ReceiveGain=11);
for gNBIdx = 1:length(gNBs)
% Resource allocation type value 0 indicates a noncontiguous allocation of
% frequency-domain resources in terms of RBGs
configureScheduler(gNBs(gNBIdx),ResourceAllocationType=0)
end
numCells = length(gNBs);
cellRadius = 500; % Radius of each cell (in meters)
numUEsPerCell = 4;
uePositions = generateUEPositions(cellRadius,gNBPositions,numUEsPerCell);
UEs = cell(numCells,1);
for cellIdx = 1:numCells
ueNames = "UE-" + (1:size(uePositions{cellIdx},1));
UEs{cellIdx} = nrUE(Name=ueNames,Position=uePositions{cellIdx},ReceiveGain=11);
connectUE(gNBs(cellIdx),UEs{cellIdx},FullBufferTraffic="DL")
end
addNodes(networkSimulator,gNBs);
for cellIdx = 1:numCells
addNodes(networkSimulator,UEs{cellIdx})
end
channelModel = "3GPP TR 38.901";
if strcmp(channelModel,"3GPP TR 38.901")
% Define scenario boundaries
pos = [reshape([gNBs.Position],3,[])];
minX = min(pos(1,:)); % x-coordinate of the left edge of the scenario in meters
minY = min(pos(2,:)); % y-coordinate of the bottom edge of the scenario in meters
width = max(pos(1,:)) – minX; % Width (right edge of the 2D scenario) in meters, given as maxX – minX
height = max(pos(2,:)) – minY; % Height (top edge of the 2D scenario) in meters, given as maxY – minY
% Create the channel model
channel = h38901Channel(Scenario="UMa",ScenarioExtents=[minX minY width height]);
% Add the channel model to the simulator
addChannelModel(networkSimulator,@channel.channelFunction);
connectNodes(channel,networkSimulator,InterfererHasSmallScale=true);
end
cellToAnalyze = gNBs(gNBOfInterestIdx).ID;
enableTraces = true;
linkDir = 0; % Indicates DL
if enableTraces
simSchedulingLogger = cell(numCells,1);
simPhyLogger = cell(numCells,1);
for cellIdx = 1:numCells
% Create an object for MAC DL scheduling traces logging
simSchedulingLogger{cellIdx} = helperNRSchedulingLogger(numFrameSimulation, …
gNBs(cellToAnalyze),UEs{cellToAnalyze},LinkDirection=linkDir);
% Create an object for PHY layer traces logging
simPhyLogger{cellIdx} = helperNRPhyLogger(numFrameSimulation,gNBs(cellToAnalyze), …
UEs{cellToAnalyze});
end
end
numMetricPlotUpdates = numFrameSimulation;
showSchedulerMetrics = true;
showPhyMetrics = true;
metricsVisualizer = helperNRMetricsVisualizer(gNBs(cellToAnalyze),UEs{cellToAnalyze}, …
CellOfInterest=cellToAnalyze,NumMetricsSteps=numMetricPlotUpdates, …
PlotSchedulerMetrics=showSchedulerMetrics,PlotPhyMetrics=showPhyMetrics,LinkDirection=linkDir);
simulationLogFile = "simulationLogs"; % For logging the simulation traces
enableMobility = false;
if enableMobility
ueSpeedRange = [1 1000]; % In meters per second
ueWithMobility = UEs{cellToAnalyze}(2); % Get UE-2 in the cell of interest
% Add random waypoint mobility to the selected UE
addMobility(ueWithMobility,SpeedRange=ueSpeedRange,BoundaryShape="circle",Bounds=[gNBs(cellToAnalyze).Position(1:2) cellRadius])
end
networkVisualizer = helperNetworkVisualizer(SampleRate=100); % Sample rate indicates the visualization refresh rate in Hertz
% Show the cell boundary of each gNB
showBoundaries(networkVisualizer,gNBPositions,cellRadius,cellToAnalyze)
% Calculate the simulation duration (in seconds)
simulationTime = numFrameSimulation*1e-2;
% Run the simulation
run(networkSimulator,simulationTime);
========================================================code
Error=====================================================
>> test001
Error using nrGNB/getMCSTable (line 1331)
Invalid default value for property ‘MCSTable’ in class ‘nrGNB’:
Unable to resolve the name ‘nr5g.internal.MACConstants.MCSTable’.
Error in test001 (line 8)
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, … Dear All,
Thanks in advance. Do I need to include any package?
==================code
wirelessnetworkSupportPackageCheck
rng("default") % Reset the random number generator
numFrameSimulation = 20; % Simulation time in terms of number of 10 ms frames
networkSimulator = wirelessNetworkSimulator.init;
gNBPositions = [1700 600 30; 3000 600 30; 2500 2000 30];
gNBOfInterestIdx = 3; % Specify an integer value in the range [1, number of gNBs]
gNBNames = "gNB-" + (1:size(gNBPositions,1));
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …
ChannelBandwidth=10e6,SubcarrierSpacing=30e3,TransmitPower=32,ReceiveGain=11);
for gNBIdx = 1:length(gNBs)
% Resource allocation type value 0 indicates a noncontiguous allocation of
% frequency-domain resources in terms of RBGs
configureScheduler(gNBs(gNBIdx),ResourceAllocationType=0)
end
numCells = length(gNBs);
cellRadius = 500; % Radius of each cell (in meters)
numUEsPerCell = 4;
uePositions = generateUEPositions(cellRadius,gNBPositions,numUEsPerCell);
UEs = cell(numCells,1);
for cellIdx = 1:numCells
ueNames = "UE-" + (1:size(uePositions{cellIdx},1));
UEs{cellIdx} = nrUE(Name=ueNames,Position=uePositions{cellIdx},ReceiveGain=11);
connectUE(gNBs(cellIdx),UEs{cellIdx},FullBufferTraffic="DL")
end
addNodes(networkSimulator,gNBs);
for cellIdx = 1:numCells
addNodes(networkSimulator,UEs{cellIdx})
end
channelModel = "3GPP TR 38.901";
if strcmp(channelModel,"3GPP TR 38.901")
% Define scenario boundaries
pos = [reshape([gNBs.Position],3,[])];
minX = min(pos(1,:)); % x-coordinate of the left edge of the scenario in meters
minY = min(pos(2,:)); % y-coordinate of the bottom edge of the scenario in meters
width = max(pos(1,:)) – minX; % Width (right edge of the 2D scenario) in meters, given as maxX – minX
height = max(pos(2,:)) – minY; % Height (top edge of the 2D scenario) in meters, given as maxY – minY
% Create the channel model
channel = h38901Channel(Scenario="UMa",ScenarioExtents=[minX minY width height]);
% Add the channel model to the simulator
addChannelModel(networkSimulator,@channel.channelFunction);
connectNodes(channel,networkSimulator,InterfererHasSmallScale=true);
end
cellToAnalyze = gNBs(gNBOfInterestIdx).ID;
enableTraces = true;
linkDir = 0; % Indicates DL
if enableTraces
simSchedulingLogger = cell(numCells,1);
simPhyLogger = cell(numCells,1);
for cellIdx = 1:numCells
% Create an object for MAC DL scheduling traces logging
simSchedulingLogger{cellIdx} = helperNRSchedulingLogger(numFrameSimulation, …
gNBs(cellToAnalyze),UEs{cellToAnalyze},LinkDirection=linkDir);
% Create an object for PHY layer traces logging
simPhyLogger{cellIdx} = helperNRPhyLogger(numFrameSimulation,gNBs(cellToAnalyze), …
UEs{cellToAnalyze});
end
end
numMetricPlotUpdates = numFrameSimulation;
showSchedulerMetrics = true;
showPhyMetrics = true;
metricsVisualizer = helperNRMetricsVisualizer(gNBs(cellToAnalyze),UEs{cellToAnalyze}, …
CellOfInterest=cellToAnalyze,NumMetricsSteps=numMetricPlotUpdates, …
PlotSchedulerMetrics=showSchedulerMetrics,PlotPhyMetrics=showPhyMetrics,LinkDirection=linkDir);
simulationLogFile = "simulationLogs"; % For logging the simulation traces
enableMobility = false;
if enableMobility
ueSpeedRange = [1 1000]; % In meters per second
ueWithMobility = UEs{cellToAnalyze}(2); % Get UE-2 in the cell of interest
% Add random waypoint mobility to the selected UE
addMobility(ueWithMobility,SpeedRange=ueSpeedRange,BoundaryShape="circle",Bounds=[gNBs(cellToAnalyze).Position(1:2) cellRadius])
end
networkVisualizer = helperNetworkVisualizer(SampleRate=100); % Sample rate indicates the visualization refresh rate in Hertz
% Show the cell boundary of each gNB
showBoundaries(networkVisualizer,gNBPositions,cellRadius,cellToAnalyze)
% Calculate the simulation duration (in seconds)
simulationTime = numFrameSimulation*1e-2;
% Run the simulation
run(networkSimulator,simulationTime);
========================================================code
Error=====================================================
>> test001
Error using nrGNB/getMCSTable (line 1331)
Invalid default value for property ‘MCSTable’ in class ‘nrGNB’:
Unable to resolve the name ‘nr5g.internal.MACConstants.MCSTable’.
Error in test001 (line 8)
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, … matlab, 5g interferance MATLAB Answers — New Questions