% Vw_vs_level.m; Ledwell, 9/9/05
% looks at Vw versus level data for all the tows
% Vw is a list of water volumes; 
% level is a list of the fractions of the distance of the water level
% between the lower and upper sensor electrodes in the tower, from which
% Vw can be estimated if Vw is NaN
% The volume of this part of the tower is 3 ml based on an estimate of
% i.d. of 14 mm and distance between electrodes of 20 mm.
% I make a subjective estimate of the relation to be Vw = 43 ml + level*5.5
% ml, which is twice as strong as estimated from the dimensions of the
% tower.  The difference must be due to different amounts of gas in the
% lower parts of the tower, depending on the level.

Vw=[];
level=[];
for i=1:9
    s=int2str(i);
    if length(s)==1
        s=['0',s];
    end
    eval(['load ..\Profiles\Tow_',s,'.txt'])
    eval(['Vw',s,'=Tow_',s,'(:,4);'])
    eval(['level',s,'=Tow_',s,'(:,5);'])
    eval(['Vw=[Vw; Vw',s,'];'])
    eval(['level=[level; level',s,'];'])
end

k=find(~isnan(Vw) & ~isnan(level));

figure(1); clf
plot(Vw(k),level(k),'o')
[fit,par]=try_fit(Vw(k),level(k),1);


