Is there a way to stop raytracing with parallel Toolbox from ignoring Buildings
Show older comments
Background:
I'm searching for a way to speed up raytracing to multiple receivers (about 500-2000) so I tried to run it with the parallel Toolbox.
Bug/Problem:
The result is what you see in the Image below, there are no rays to the first site (that is worked on by the first core).
But for every site is following (here site 2 in the middle) matlab keeps ignoring the buildings and the terrain (if there is one).
I'm Aware that this happens because the site viewer with the buildings is only loaded on the first instance and the other
instances of matlab are calculation without any site information.
Question:
Is there any way to avoid this bug or to speed up the raytrcaing process?
Thank you in advance for your help
Marcel

Example:
clear
clc
close all
%Model constants
f=500e6;%in Hz
%% Load Map
%for the map I chose a Part of Munich
%(48.139105,48.135141,11.571326,11.578850) downloaded from https://www.openstreetmap.org/export#map=17/48.137203/11.576350
viewer = siteviewer("Buildings","map.osm","Basemap","topographic");
%% Creating TX sites
site1 = txsite("Name","TX_1", ...
"Latitude",48.139, ...
"Longitude", 11.5715, ...
"AntennaHeight",1, ... %in m
"TransmitterPower", 5, ... %in W
"TransmitterFrequency",f);
site2 = txsite("Name","TX_2", ...
"Latitude",48.138, ...
"Longitude", 11.5715, ...
"AntennaHeight",1, ... %in m
"TransmitterPower", 5, ... %in W
"TransmitterFrequency",f);
show(site1);
show(site2);
tx=[site1 site2]
%% Creatin RX sites
rx = cell(1,2);
rx{1,1} = rxsite("Name","rx1", ...
"Latitude",48.1352,...
"Longitude",11.578, ...
"AntennaHeight",1.5, ...
"Antenna",'isotropic', ...
'ReceiverSensitivity',-103);
rx{1,2} = rxsite("Name","rx2", ...
"Latitude",48.137,...
"Longitude",11.575, ...
"AntennaHeight",1.5, ...
"Antenna",'isotropic', ...
'ReceiverSensitivity',-103);
show(rx{1,1})
show(rx{1,2})
% propagation model
rtpm = propagationModel("raytracing", ...
"Method","sbr", ...
"MaxNumReflections",2, ...
"BuildingsMaterial","concrete", ...
"TerrainMaterial","vegetation");
%% raytracing
size(rx,2)
%%
rays= cell(size(tx,2),size(rx,2));
lenght= size(tx,2);
parfor i=1:size(rx,2);
ray = raytrace(tx,rx{1,i},rtpm);
for j=1:lenght
rays{j,i} = ray{j,1};
end
end
%% plot existing rays
disp("plotting rays")
for i=1:size(rays,1)
for j=1:size(rays,2)
if (~isempty(rays{i,j}))
plot(rays{i,j});
end
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Propagation and Channel Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!