load c:\dataccvi\wirescan\analysis\vt_ave_buck_630.dat;
load c:\dataccvi\wirescan\analysis\vt_for_buck_630.dat;
load c:\dataccvi\wirescan\analysis\vt_rev_buck_630.dat;
x=vt_ave_buck_630(:,2);
vt_ave=vt_ave_buck_630(:,3);
vt_for=vt_for_buck_630(:,3);
vt_rev=vt_rev_buck_630(:,3);
x_rev=vt_rev_buck_630(:,2);
vt_rev_flip=flipud(vt_rev);
vt_rev_flip_shift=vt_rev_flip - vt_rev_flip(1);
plot(x, vt_ave, x, vt_for, x_rev, vt_rev+.001, x, vt_rev_flip, x, vt_rev_flip_shift)
vtn=polyfit(x/.05, vt_ave, 8);
vtn
N = 400;
R0 = .05;
D1 = .011379;
D0 = .001727;
C = zeros(8, 8);
for n=3:10
   j=n-2;
   C(j, n-2)=N*R0*(1./n)*(1./(R0.^(n-j)))*(n*(n-1)/2)*2*(D1^2-D0^2);
end;
VTn=fliplr(vtn(1:8));
BLn=inv(C)*VTn';
C
inv(C)
VTn
BLn
bl_x=zeros(length(x), 1);
for n=3:1:10
  bl_x = bl_x + BLn(n-2)*(x/.05).^(n-1);
end;
plot(x/.05, bl_x)