load c:\dataccvi\wirescan\analysis\vt_ave_single_630.dat;
load c:\dataccvi\wirescan\analysis\vt_for_single_630.dat;
load c:\dataccvi\wirescan\analysis\vt_rev_single_630.dat;
x=vt_ave_single_630(:,2);
vt_ave=vt_ave_single_630(:,3);
vt_for=vt_for_single_630(:,3);
vt_rev=vt_rev_single_630(:,3);
x_rev=vt_rev_single_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, 9);
vtn
N = 400;
R0 = .05;
D1 = .011379;
D0 = .001727;
C = zeros(9, 9);
for n=2:10
   j=n-1;
   C(j, n-1)=N*R0*(1./n)*(1./(R0.^(n-j)))*(n)*((D1-D0)/2.-(-(D1-D0)/2.));
end;
VTn=fliplr(vtn(1:9));
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-1)*(x/.05).^(n-1);
end;
plot(x/.05, bl_x)