disp('Введите № климата 1-6 в соответствии с картой, или 7 – морской')
if Nk==1
Ma=39.60;
Ya=0.33;
Ur=3;
elseif Nk==2 || Nk==5
Ma=29.73;
Ya=0.27;
Ur=1;
elseif Nk==3
Ma=19.30;
Ya=0.32;
Ur=4;
elseif Nk==4
Ma=38.50;
Ya=0.27;
Ur=5;
elseif Nk==6
Ma=33.20;
Ya=0.27;
Ur=1;
elseif Nk==7
Ma=26.00;
Ya=0.27;
Ur=2;
end
tet=((Ugr+Ugp)*pi*1e3)/180+0.12*R;
Hn=1e-3*tet*R/4;
hn=4e-6*tet^2*6370/24;
Ln=20*log10(5+Ya*Hn)+4.34*Ya*hn;
ds=8.4933*tet;
if Ur==1
Y90=-2.2-(8.1-2.3e-4*min(f,4000))*exp(-0.137*hn);
elseif Ur==2
Y90=-9.5-3*exp(-0.137*hn);
elseif Ur==3
if ds<100
Y90=-8.2;
elseif 100<ds<1000
Y90=1.006e-8*ds^3-2.569e-5*ds^2+0.02242*ds-10.2;
else
Y90=-3.4;
end
elseif Ur==4
if ds<100
Y90=-10.845;
elseif 100<ds<550
Y90=-4.5e-7*ds^3+4.45e-4*ds^2-0.122*ds-2.645;
else
Y90=-8.4;
end
elseif Ur==5
if ds<100
Y90=-11.5;
elseif 100<ds<1000
Y90=-8.519e-8*ds^3+7.444e-5*ds^2+4.18e-4*ds-12.1;
else
Y90=-4;
end
end
Cq=1.473e14*exp(-((Tpr-108.8)/1.534)^2)-0.2272*exp(-((Tpr-95.58)/7.786)^2)+9.047*exp(-((Tpr-153.3)/44.08)^2);
Yq=Cq*Y90;
La=0.07*exp(0.055*(Gr+Gp));
L2g=Ma+30*log10(f)+10*log10(R)+30*log10(tet)+Ln+La-Gr-Gp-Pfr-Pfp-Yq;
dq=R+8.5*((Ugr+Ugp)*pi*1e3)/180;
if abs(Tpr-50)<abs(Tpr-90)
q=50;
elseif abs(Tpr-90)<abs(Tpr-95)
q=90;
elseif abs(Tpr-95)<abs(Tpr-99)
q=95;
elseif abs(Tpr-99)<abs(Tpr-99.9)
q=99;
else
q=99.9;
end
if Nk==1
if q==50
p1=-4.238e-7;
p2=-0.0008043;
p3=4.185;
elseif q==90
p1=3.111e-7;
p2=-0.001963;
p3=4.108;
elseif q==95
p1=7.556e-7;
p2=-0.002476;
p3=3.956;
elseif q==99
p1=4.225e-7;
p2=-0.002412;
p3=3.701;
elseif q==99.9
p1=-3.766e-8;
p2=-0.00114;
p3=3.072;
end
elseif Nk==2 || Nk==3
if q==50
p1=2.506e-6;
p2=-0.006031;
p3=7.07;
elseif q==90
p1=2.376e-6;
p2=-0.005205;
p3=5.933;
elseif q==95
p1=1.857e-6;
p2=-0.004377;
p3=5.44;
elseif q==99
p1=1.009e-6;
p2=-0.003069;
p3=4.821;
elseif q==99.9
p1=2.279e-7;
p2=-0.001305;
p3=3.59;
end
elseif Nk==4
if q==50
p1=4.952e-6;
p2=-0.01447;
p3=12.99;
elseif q==90
p1=4.596e-6;
p2=-0.01175;
p3=10.12;
elseif q==95
p1=4.776e-6;
p2=-0.01076;
p3=8.707;
elseif q==99
p1=2.23e-6;
p2=-0.00675;
p3=6.837;
elseif q==99.9
p1=2.229e-6;
p2=-0.005639;
p3=5.548;
end
elseif Nk==5||Nk==6||Nk==7
if q==50
p1=5.358e-6;
p2=-0.1255;
p3=10.25;
elseif q==90
p1=5.507e-6;
p2=-0.0118;
p3=9.033;
elseif q==95
p1=3.981e-6;
p2=-0.00935;
p3=7.91;
elseif q==99
p1=3.349e-6;
p2=-0.008022;
p3=7.169;
elseif q==99.9
p1=2.489e-7;
p2=-0.006297;
p3=6.122;
end
end
dL=p1*dq^2+p2*dq+p3;
L2m=L2g+dL;
L2c=L2m+4.676*exp(-((R-124.9)/332.4)^2)+3.165*exp(-((R-3828)/508.3)^2);
if