w=400;m=127;
d=w/m;
f=d/2:d:w-d/2;k=max(size(f));l=linspace(.985,.872,127);
c=(.083*10^(-3)).*ones(1,k);

gamma=zeros(1,k);
for t=1:k
r(t)=438.29996+33.3*(.01*f(t))+5.012*(.01*f(t))^2-.42*(.01*f(t))^3+.012*(.01*f(t))^4-.001*(.01*f(t))^5;

gamma(t)=sqrt((r(t)+i*2*pi*f(t)*l(t))*(i*2*pi*f(t)*c(t)));
z0(t)=sqrt((r(t)+i*2*pi*f(t)*l(t))/(i*2*pi*f(t)*c(t)));
end
alfa=unwrap(real(gamma));%neper/mi(mila)
for t=1:k

hc(t)=exp(-alfa(t)*2*9000*(.3048/1609.3));
hc1(t)=exp(-1.4*.5*f(t)^.5);
end
%semilogy(f,hc)
%hold on
%semilogy(f,hc1)
 [m,v]=min(abs(hc-hc1))
aten1=(8.68*.3048*12000/1609.3).*alfa;
f1=f.^.5;
aten2=(4.34*1.4*12000/18000).*f1;
plot(f1,aten1)
hold on
plot(f1,aten2)
xlabel('radical din f(exprimata in kHz)');
ylabel('atenurea (dB)');
title('Atenuarea unei perechi cu l=3,66 km si d=0,4 mm pentru doua modele')
gtext('model f^.5');
gtext('atenuarea calculata din parametrii primari')
