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

조회 수: 2 (최근 30일)
David Emerson
David Emerson 2024년 1월 1일
댓글: David Emerson 2024년 1월 2일
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