%% 大气传播射线跟踪法
%clc;clear all;
function xsitax = Main_ray(M0,hmax,ht,HH1,HH2,slopeElvated1,slopeElvated2,xmaxkm,sitamax)
%% 参数说明
% hmax: 最大显示高度(m);dh:高度步长(m);ht:发射天线高度(m);
% HH1:波导基础层高度(m);HH2:波导层+基础层高度/蒸发波导高度(m);
% slopeElvated1:基础层斜率(/km);slopeElvated2:陷获层斜率(/km);
% xmaxkm:最大显示距离(km);ae:等效地球半径(m)
% sita0:天线初始仰角范围(°)
%% 参数输入
hmax = round(hmax);%%四舍五入返回
%hmax= 500;
%M0=330;sitamax=4;
dh = 1;
h = 0:dh:hmax;
%ht = 20;
%HH1=0;%基础层高度(m)
%HH2=50;%波导层+基础层高度(m)
%slopeElvated1=118;%基础层斜率/km
%slopeElvated2=-120;%陷获层斜率/km
%xmaxkm = 200;
%% 折射率剖面和折射率梯度
%M = Sub_evaporation(h,HH2,M0);
M = Sub_FourParaRefPro(M0,h,HH1,HH2,slopeElvated1,slopeElvated2);
%M = Sub_StanRefPro(h);
% M = hunhebodao(M0,h,HH1,HH2,HH3,slopeElvated1,slopeElvated2);
for i = 1:1:length(h)-1
g(i) = (M(i+1)-M(i))/(h(i+1)-h(i));
end
g(i+1) = g(i);
ae = 6371*1000;
%% 计算
sitax = zeros(1,2);
iii = 2;
sitax(1,:) = [0,0.0000001];
sitamax = sitamax*180/pi;
for sita0 =-0.6:0.05:0.6
id = find(ht == h); %%返回ht=h时的i值
gi = g(id);
gi1 = g(id-1);
dhi = dh;
sita1 = sita0*pi/180;
x1 = 0; h1 = ht; u = []; u(1,1) = x1; u(1,2) = h1;
for ii = 1:1:hmax
if gi == 0
%% 梯度为0时
dhi = dh;
sita2 = sita1;
h2 = h1+dhi;
x2 = x1+cot(sita2)*dh;
id = find(round(h2) == h);
gi = g(id);
gi1 = g(id-1);
else
%% 梯度不为0时
if sita1>0 && sita1<= (3*pi/180)
%% 仰角大于0小于3°时,射线向上传播
r = sita1*sita1+2*gi*dhi;
if r>=0
dhi = min(h(id+1)-h1,dh);
sita2 = sqrt(sita1*sita1+2*gi*dhi);
h2 = h1+dhi;
x2 = x1+(sita2-sita1)/gi;
else
sita2 = 0;
dhi = (sita2*sita2-sita1*sita1)/2/gi;
h2 = h1+dhi;
x2 = x1+(sita2-sita1)/gi;
end
id = min(find( h >= h2));
gi = g(id);
gi1 = g(id-1);
elseif sita1<0 && sita1>= -3*pi/180
%% 仰角小于0大于-3°时,射线向下传播
r = sita1*sita1-2*gi1*dhi;
if r>=0
if h1 == 0
dhi = 0;
sita2 = -sita1; %% 擦地角
h2 = h1;
x2 = x1;
id = min(find(h >= h2));
gi = g(id);
sitax(iii,:) = [x1/1000,sita2]; %%保存擦地角
iii = iii+1;
else
dhi = min(h1-h(id-1),dh);
sita2 = -sqrt(sita1*sita1-2*gi1*dhi);
h2 = h1-dhi;
x2 = x1+(sita2-sita1)/gi1;
id = min(find(h >= h2));
if id == 1
gi = g(id); gi1 = g(id);
else
gi = g(id); gi1 = g(id-1);
end
end
else
sita2 = 0;
dhi = (sita2*sita2-sita1*sita1)/2/gi1;
h2 = h1+dhi;
x2 = x1+(sita2-sita1)/gi1;
id = min(find(h >= h2));
gi = g(id);
end
elseif sita1 == 0
%% 仰角为0
if gi>0
%% 射线向上传播
r = sita1*sita1+2*gi*dhi;
if r>=0
dhi = min(h(id+1)-h1,dh);
sita2 = sqrt(sita1*sita1+2*gi*dhi);
h2 = h1+dhi;
x2 = x1+(sita2-sita1)/gi;
else
sita2 = 0;
dhi = (sita2*sita2-sita1*sita1)/2/gi;
h2 = h1+dhi;
x2 = x1+(sita2-sita1)/gi;
end
id = min(find(h >= h2));
if id == 1
gi = g(id); gi1 = g(id);
else
gi = g(id); gi1 = g(id-1);
end
elseif gi<0
%% 射线向下传播
r = sita1*sita1-2*gi1*dhi;
if r>=0
if h1 == 0
dhi = 0;
sita2 = -sita1;
h2 = h1;
x2 = x1;
id = min(find(h >= h2));
gi = g(id+1);
sitax(iii,:) = [x1/1000;sita2]; %%保存擦地角
iii = iii+1;
else
dhi = min(h1-h(id-1),dh);
sita2 = -sqrt(sita1*sita1-2*gi1*dhi);
h2 = h1-dhi;
x2 = x1+(sita2-sita1)/gi1;
id = min(find(h >= h2));
if id == 1
gi = g(id); gi1 = g(id);
else
gi = g(id); gi1 = g(id-1);
end
end
else
sita2 = 0;
dhi = (sita2*sita2-sita1*sita1)/2/gi1;
h2 = h1+dhi;
x2 = x1+(sita2-sita1)/gi1;
id = min(find(h >= h2));
gi = g(id);
end
end
elseif sita1>(3*pi/180)
%% 仰角大于3°时
dhi = min(h(id+1)-h1,dh);
h2 = h1+dhi;
sq = sqrt(M(id+1)^2-(M(1)*cos(sita1))^2);
x2 = x1+(ae/(ae+h2))*(M(1)*cos(sita1)*dhi)/sq;
sita2 = atan(dhi/(x2-x1));
id = min(find(h >= h2));
gi = g(id);
gi1 = g(id-1);
elseif sita1<(-3*pi/180)
%% 仰角小于3°时
if h1 == 0
dhi = 0;
sita2 = -sita1;
h2 = h1;
x2 = x1;
id = min(find(h >= h2));
gi = g(id);
else
dhi = min(h1-h(id-1),dh);
h2 = h1-dhi;
sq = sqrt(M(id+1)^2-(M(1)*cos(sita1))^2);
x2 = x1+(ae/(ae+h2))*(M(1)*cos(sita1)*dhi)/sq;
sita2 = -atan(dhi/(x2-x1));
id = min(find(h >= h2));
if id == 1
gi = g(id); gi1 = g(id);
else
gi = g(id); gi1 = g(id-1);
end
end
end
end
u(ii,1) = x2; u(ii,2) = h2;
x1 = x2; h1 = h2; sita1 = sita2;
if x1>xmaxkm*1000
break;
end
if h1 >= hmax-1
break;
end
end
figure(1);
plot(u(:,1)/1000,u(:,2),'r');
hold on;
xlabel('距离(km)');
ylabel('高度(m)');
end
xsitax = sortrows(sitax,1);
if xsitax(end,1)<xmaxkm
xsitax(end+1,1) = xmaxkm;
xsitax(end,2) = 0.000001;
end
没有合适的资源?快使用搜索试试~ 我知道了~
【电磁波】基于matlab大气波导电磁波射频追踪仿真【含Matlab源码 3559期】.zip
共7个文件
m:6个
jpg:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 43 浏览量
2023-12-05
18:09:37
上传
评论
收藏 39KB ZIP 举报
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、物理应用 仿真:导航、地震、电磁、电路、电能、机械、工业控制、水位控制、直流电机、平面电磁波、管道瞬变流、刚度计算 光学:光栅、杨氏双缝、单缝、多缝、圆孔、矩孔衍射、夫琅禾费、干涉、拉盖尔高斯、光束、光波、涡旋 定位问题:chan、taylor、RSSI、music、卡尔曼滤波UWB 气动学:弹道、气体扩散、龙格库弹道 运动学:倒立摆、泊车 天体学:卫星轨道、姿态 船舶:控制、运动 电磁学:电场分布、电偶极子
资源推荐
资源详情
资源评论
收起资源包目录
【电磁波】基于matlab大气波导电磁波射频追踪仿真【含Matlab源码 3559期】.zip (7个子文件)
【电磁波】基于matlab大气波导电磁波射频追踪仿真【含Matlab源码 3559期】
Sub_FourParaRefPro.m 560B
Sub_evaporation.m 170B
运行结果.jpg 39KB
Main_ray.m 8KB
Sub_StanRefPro.m 84B
hunhebodao.m 625B
untitled.m 42B
共 7 条
- 1
资源评论
海神之光
- 粉丝: 3w+
- 资源: 2094
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功