w=40000;m=1270;
l0=18000;beta=10^(-10.5);
l=600:600:18000;
l=linspace(.000985,.000872,127);
c=(.083*10^(-6)).*ones(1,k);hc=ones(1,k);

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

gamma(t)=sqrt((r(t)+i*2*pi*f(t)*l(t))*(i*2*pi*f(t)*c(t)));
end
alfa1=unwrap(real(gamma));
for o=1:max(size(l))
alfa(o)=1.158*l(o)/l0;
d=w/m;
f=d/2:d:w-d/2;
k=max(size(f));
k=max(size(f));p=ones(1,k);


for n=1:k
hc(n)=exp(-alfa(o)*f(n)^.5);
hx(n)=beta*f(n)^1.5;
end
cap(o)=0
for n=1:k
cap(o)= cap(o)+d*1000*log2(1+hc(n)/(hx(n)));
end

for t=1:k

hc1(t)=exp(-alfa1(t)*2*l(o)*(.3048/1609.3));
%hc1(t)=exp(-1.4*.5*f(t)^.5);

end
cap1(o)=0
for n=1:k
cap1(o)= cap1(o)+d*1000*log2(1+hc1(n)/(hx(n)));
end
end
hold on
semlogy(l,cap)
seilogy(l,cap1)