f11=[0  2500 10000 20000 40000  100000 150000 200000 400000  500000 650000 750000 850000 1000000 1100000];
f=2000:2000:1100000;%r11 este rez. per. de .5mm;
z=100;
a=1;
b=2;d=2000;
r11=[179 179.015 179.244 179.97 182.79 199.608 218.721 239.132 316.23 350.243 396.528 424.835 451.480 488.857 512.317];
l11=10^(-6)*[673.574 673.466 672.923 671.98 669.716 661.677 654.622 647.735 624.309 615.202 604.192 598.261 593.217 586.966 583.495];
r12=[ 113 113.028 113.442 114.737 119.523 143.115 164.938 185.689 255.575 284.753 323.844 347.542 369.758 400.816 420.264];
l12=10^(-6)*[699.258 697.943 693.361 687.008 674.593 642.718 622.050 605.496 563.845 551.323 537.868 531.212 525.813 519.402 515.956];
r63=spline(f11,r12,f);
l63=spline(f11,l12,f);
c63= 50*10^(-9).*ones(size(f));
g63=zeros(size(f));
d63=.5;
for k=1:length(f);
z63(k)=r63(k)+2*pi*f(k)*l63(k)*i;
y63(k)=g63(k)+2*pi*f(k)*c63(k)*i;
zc63(k)=sqrt(z63(k)/y63(k));
gamma63(k)=sqrt(z63(k)*y63(k));
B63(k)=zc63(k)*sinh(gamma63(k)*d63);
A63(k)=cosh(gamma63(k)*d63);
D63(k)=A63(k);
C163(k)=(1/zc63(k))*sinh(gamma63(k)*d63);
e63(k)=A63(k)*D63(k)-B63(k)*C163(k);

alfa63(k)=real(gamma63(k));
beta63(k)=imag(gamma63(k));
tu63(k)=r63(k)/(2*pi*f(k)*l63(k));
if tu63(k)>=10
   zc63a(k)= (1-i)*sqrt(r63(k)/(4*pi*c63(k)*f(k)));
   alfa63a(k)=sqrt(r63(k)*pi*c63(k)*f(k));
   beta63a(k)=alfa63a(k);
lamda63(k)=2*pi/beta63(k);
elseif (tu63(k)>=.4)&(tu63(k)<10)
   zc63a(k)=z;
   alfa63a(k)=a;
   beta63a(k)=b;
lamda63(k)=2*pi/beta63(k);

else
   v63(k)=sqrt(l63(k)/c63(k));
   zc63a(k)=v63(k)*(1-i*r63(k)/(l63(k)*4*pi*f(k)));
   alfa63a(k)=r63(k)/(2*v63(k));
   beta63a(k)=2*pi*f(k)*sqrt(l63(k)*c63(k));
lamda63(k)=2*pi/beta63(k);

end
end
m=length(f);
for l1=1:m-1
tg63(l1)=(beta63(l1+1)-beta63(l1))/(2*pi*d);
vg63(l1)=1/tg63(l1);
end
ff=f(:,1:m-1);
plot(ff,tg63)
hold on






r2=spline(f11,r11,f);
l2=spline(f11,l11,f);
g2=zeros(size(f));
c2= 50*10^(-9).*ones(size(f));
%g=zeros(size(f));

z11=zeros(size(f));y=zeros(size(f)); d2=1.25;%portiunea cu d=.5mm;
d3=.3048*1.5;%prima derivatie;
d4=.3048*1.5;%a 2-a derivatie;
d6=.3048*1.5;% a 3-a derivatie;
for k=1:length(f);
z11(k)=r2(k)+2*pi*f(k)*l2(k)*i;
y2(k)=g2(k)+2*pi*f(k)*c2(k)*i;
zc2(k)=sqrt(z11(k)/y2(k));
gamma2(k)=sqrt(z11(k)*y2(k));
B2(k)=zc2(k)*sinh(gamma2(k)*d2);
A2(k)=cosh(gamma2(k)*d2);
D2(k)=A2(k);
C21(k)=(1/zc2(k))*sinh(gamma2(k)*d2);
e2(k)=A2(k)*D2(k)-B2(k)*C21(k);

alfa2(k)=real(gamma2(k));
beta2(k)=imag(gamma2(k));
tu51(k)=r2(k)/(2*pi*f(k)*l2(k));
if tu51(k)>=10
   zc51a(k)= (1-i)*sqrt(r2(k)/(4*pi*c2(k)*f(k)));
   alfa51a(k)=sqrt(r2(k)*pi*c2(k)*f(k));
   beta51a(k)=alfa51a(k);
lamda51(k)=2*pi/beta51a(k);


elseif (tu51(k)>=.4)&(tu51(k)<10)
   zc51a(k)=z;
   alfa51a(k)=a;
   beta51a(k)=b;
lamda51(k)=2*pi/beta51a(k);


else
   v2(k)=sqrt(l2(k)/c2(k));
   zc51a(k)=v2(k)*(1-i*r2(k)/(l2(k)*4*pi*f(k)));
   alfa51a(k)=r2(k)/(2*v2(k));
   beta51a(k)=2*pi*f(k)*sqrt(l2(k)*c2(k));
lamda51(k)=2*pi/beta51a(k);


end
end
m=length(f);
for l1=1:m-1
tg51(l1)=(beta2(l1+1)-beta2(l1))/(2*pi*d);
vg51(l1)=1/tg51(l1);
end
ff=f(:,1:m-1);
plot(ff,tg51)

