Error using pathloss with 'CoordinateSystem' set to 'cartesian'.

2 次查看(过去 30 天)
I'm trying to run a simple pthloss calculation using the Longley-Rice model and a cartesian coordinate system. Below is a simple example that fails. I've run this in 2020b, 2023a and the online 2023b and they all give me the same error.
% initialize model
pm_lr = propagationModel("longley-rice", 'ClimateZone', 'maritime-over-sea', 'GroundPermittivity', 68, 'GroundConductivity', 5.5);
% create tx site
tx = txsite('Name','TX1', 'CoordinateSystem','cartesian', 'AntennaPosition', [0; 0; 1], 'AntennaHeight',1, 'TransmitterFrequency',101.5e6, 'TransmitterPower', 1);
% create rx site
rx = rxsite('Name','RX', 'CoordinateSystem','cartesian', 'AntennaPosition', [1000; 0; 1], 'AntennaHeight', 1);
% calculate the loss
[tx_loss, tx_info] = pathloss(pm_lr, rx, tx, 'Map', 'none');
The cartesian coordinate system is not well documented, but I think that I have everything correct. I get the following error:
Error using rfprop.PropagationModel/pathloss
Terrain propagation models are not supported for sites with 'CoordinateSystem' set to 'cartesian'.
Error in rfprop.LongleyRice/pathloss (line 152)
[pl, info] = pathloss@rfprop.PropagationModel(pm, rxs, txs, varargin{:});
I've tried with the 'Map' input and without the 'Map' input. nothing seems to work. Not sure if this feature really works with pathloss even though it is mentioned in the documentation.
Any help would be greatly appreciated.

回答(1 个)

Hassaan
Hassaan 2024-1-1
To address the issue with your MATLAB code and the Longley-Rice (Irregular Terrain Model) pathloss calculations, you need to switch from using Cartesian coordinates to geographic coordinates (latitude, longitude). Here's how you might adjust your code:
% initialize model
pm_lr = propagationModel("longley-rice", 'ClimateZone', 'maritime-over-sea', 'GroundPermittivity', 68, 'GroundConductivity', 5.5);
% create tx site with geographic coordinates (latitude, longitude, altitude)
% Replace 'Lat1', 'Lon1', and 'Alt1' with the actual values for the transmitter.
tx = txsite('Name', 'TX1', 'Latitude', Lat1, 'Longitude', Lon1, 'AntennaHeight', 1, 'TransmitterFrequency', 101.5e6, 'TransmitterPower', 1);
% create rx site with geographic coordinates
% Replace 'Lat2', 'Lon2', and 'Alt2' with the actual values for the receiver.
rx = rxsite('Name', 'RX', 'Latitude', Lat2, 'Longitude', Lon2, 'AntennaHeight', 1);
% calculate the loss
[tx_loss, tx_info] = pathloss(pm_lr, rx, tx, 'Map', 'none');
In this adjusted version of your code:
  • Replace 'Lat1', 'Lon1', and 'Alt1' with the latitude, longitude, and altitude of your transmitter site.
  • Replace 'Lat2', 'Lon2', and 'Alt2' with the latitude, longitude, and altitude of your receiver site.
This approach uses geographic coordinates, which the Longley-Rice model requires to account for terrain variations and other environmental factors in its path loss calculations. Make sure the latitude and longitude are in decimal degrees and the altitude is in meters.
Please ensure that you have the correct geographic coordinates for your transmitter and receiver. The altitude can be set relative to the ground level or sea level, depending on your specific scenario and the expected precision.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems
  • Electrical and Electronics Engineering
  1 个评论
David Emerson
David Emerson 2024-1-2
Thank you!. I am aware of the "geographic" option for the pathloss function and tx/rx sites, but I was interested looking at the model in the cartesian coorkdinate system, because working in lat/long changes depending on where you are on the globe, and I'm interested in propagation over water where there is typically no terrain data.
The dcumentation for pathloss in the RF Propagation toolbox specifically states that the cartesian coordinate system is an option. If this isn't the case then I think it should be removed from the documentation.
When I look at the ITM code/implementation in C++ they have options for no terrain model (not sure if MATLAB is using the NTIA model (https://github.com/NTIA/itm). If this is a Longlry-Rice implementation issue maybe a note in the description to indicate that it doesn't work in the tx/rx sites in the cartesian coordinate system.
Thanks,
dave

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 RF Propagation 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by