f1=[0 2500 10000 20000 40000 100000 150000 200000 400000 500000 650000 750000 850000 1000000 1100000];
f=10:2000:1100000;d=2000;
a=1; b=2; z=100;
r1=[280 280.007 280.11 280.44  281.748 290.433 302.070 316.393 383.562 417.427 465.785 496.218 525.274 566.521 592.628];
l1=10^(-6).*[587.132 587.075 586.738 586.099 584.443 577.878 571.525 564.889 539.437 528.409 514.272 506.304 499.343 490.494 485.481];
%c5=polyfit(f1,r1,3);

%c15=polyfit(f1,l1,3);
%r=polyval(c5,f);
%l=polyval(c15,f);
r=spline(f1,r1,f);
l=spline(f1,l1,f);
c=10^(-9)*50*ones(size(f));
g=zeros(size(f));z1=zeros(size(f));y=zeros(size(f));d1=2.35; d5=4*.3048;d7=1.5*.03048; %ultima portiune;
for k=1:length(f);
z1(k)=r(k)+2*pi*f(k)*l(k)*i;
y(k)=g(k)+2*pi*f(k)*c(k)*i;
zc(k)=sqrt(z1(k)/y(k));
gamma(k)=sqrt(z1(k)*y(k));
alfa(k)=real(gamma(k));
beta(k)=imag(gamma(k));
tu(k)=r(k)/(2*pi*f(k)*l(k));
if tu(k)>=10
   zc1(k)= (1-i)*sqrt(r(k)/(4*pi*c(k)*f(k)));
   alfa1(k)=sqrt(r(k)*pi*c(k)*f(k));
   beta1(k)=alfa1(k);
elseif (tu(k)>=.4)&(tu(k)<10)
   zc1(k)=z;
   alfa1(k)=a;
   beta1(k)=b;
else
   v(k)=sqrt(l(k)/c(k));
   zc1(k)=v(k)*(1-i*r(k)/(l(k)*4*pi*f(k)));
   alfa1(k)=r(k)/(2*v(k));
   beta1(k)=2*pi*f(k)*sqrt(l(k)*c(k));
end
end
m=length(f);
for l1=1:m-1
tg(l1)=(beta(l1+1)-beta(l1))/(2*pi*d);
end
ff=f(:,1:m-1);
plot(ff,tg)
