%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DATA FROM: %
% Spatiotemporal measurement of surfactant distribution %
% on gravityâ€“capillary waves %
% %
% http://dx.doi.org/10.1017/jfm.2015.352 %
% %
% authors: Stephen L. Strickland, Michael Shearer, Karen E. Daniels %
% %
% For additional questions e-mail: slstric2@ncsu.edu OR kdaniel@ncsu.edu %
% %
% This README file was created August 25, 2015 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% - DESCRIPTION OF CONTENTS - %%%%%%%%%%%%%%%%%%%%%%%
The dataset contains two files: Exp1.mat, and Exp2.mat which correspond to
experiments 1 and 2 from the paper, respectively. These .mat files can be
loaded into Matlab with the load command.
There are examples of how to use the contents of the .mat files at the end of
this README.txt file.
After loading the data with this command
S = load('Exp1.mat');
the structure S will contain the following fields:
Gamma0 - a scalar quantity which holds the mean surfactant
concentration in units of Gamma_c
h0 - a scalar quantity holds the mean fluid depth in units of
microns
GammaTot - a 1002x1004x8 matrix that holds the total surfactant
concentration in units of Gamma_c (see Fig 4a). The first
two indices which range from 1:1002 and 1:1004 are the
spatial dependence and correspond to the entries in xGamma
and yGamma (below). The third index, with a length of 8, is
the time dependence of the concentration and corresponds to
the entries in t (below).
GammaFW - a 1002x1004x8 matrix that holds the Faraday wave component
of the surfactant concentration in units of Gamma_c (see
Fig 4e). The first two indices which range from 1:1002 and
1:1004 are the spatial dependence and correspond to the
entries in xGamma and yGamma (below). The third index, with
a length of 8, is the time dependence of the concentration
and corresponds to the entries in t (below).
GammaMW - a 1002x1004x8 matrix that holds the meniscus wave component
of the surfactant concentration in units of Gamma_c (see
Fig 4c). The first two indices which range from 1:1002 and
1:1004 are the spatial dependence and correspond to the
entries in xGamma and yGamma (below). The third index, with
a length of 8, is the time dependence of the concentration
and corresponds to the entries in t (below).
xGamma - a 1002x1004 matrix containing the x coordinates for the
surfactant concentration matrix (above) in units of cm.
yGamma - a 1002x1004 matrix containing the y coordinates for the
surfactant concentration matrix (above) in units of cm.
hTotProfile - a 1003x1005x8 matrix that holds the best fit total fluid
surface morphology in units of microns (see Fig 6). The
first two indices which range from 1:1003 and 1:1005 are the
spatial dependence and correspond to the entries in xh and
yh (below). The third index, with a length of 8, is the
time dependence of the surface morphology and corresponds to
the entries in t (below).
hFWProfile - a 1003x1005x8 matrix that holds the best fit Faraday
component of fluid surface morphology in units of microns
(see Fig 8). The first two indices which range from 1:1003
and 1:1005 are the spatial dependence and correspond to the
entries in xh and yh (below). The third index, with a
length of 8, is the time dependence of the surface
morphology and corresponds to the entries in t (below).
hMWProfile - a 1003x1005x8 matrix that holds the best fit meniscus
component of fluid surface morphology in units of microns
(see Fig 7). The first two indices which range from 1:1003
and 1:1005 are the spatial dependence and correspond to the
entries in xh and yh (below). The third index, with a
length of 8, is the time dependence of the surface
morphology and corresponds to the entries in t (below).
xh - a 1003x1005 matrix containing the x coordinates for the
surface morphology matrix (above) in units of cm.
yh - a 1003x1005 matrix containing the y coordinates for the
surface morphology matrix (above) in units of cm.
t - a 1x8 matrix containing the effective time of each of the 8
data matrices in units of s.
%%%%%%%%%%%%%%%%%%%%%%%%% - FIRST EXAMPLE - %%%%%%%%%%%%%%%%%%%%%%%%%%%%
As an example of how to use these fields, suppose one wants to know the fluid
depth and surfactant concentration at the data point closest to x = -2.5 cm and
y = 3.6 cm during the third phase of the oscillation. One would do the
following in Matlab:
%% Set the ideal x,y values as well as the time (or phase) index
xIdeal = -2.5; % cm
yIdeal = 3.6; % cm
tINDEX = 3; % the third phase of the oscillation
%% Find the actual x,y values of the Gamma data point closest to the ideal
% This location can be found by minimizing the distance (DIST) between the
% ideal x,y and the matrices of real x,y (xGamma and yGamma).
Dist = sqrt( (S.xGamma - xIdeal).^2 + (S.yGamma - yIdeal).^2);
[xINDEX,yINDEX]=find(Dist==min(min(Dist)));
%% With the corresponding x,y indices found, we can obtain the desired values.
% To obtain the actual x,y location of the datapoint, index xGamma and yGamma.
% To obtain the value of GammaTot, index GammaTot.
xActual = S.xGamma(xINDEX,yINDEX); % cm
yActual = S.yGamma(xINDEX,yINDEX); % cm
GammaTotAtPoint = S.GammaTot(xINDEX,yINDEX,tINDEX); % Gamma_c
%% Repeat the process to find the value for hTot
Dist = sqrt( (S.xh - xIdeal).^2 + (S.yh - yIdeal).^2);
[xINDEX,yINDEX]=find(Dist==min(min(Dist)));
xActual = S.xh(xINDEX,yINDEX); % cm
yActual = S.yh(xINDEX,yINDEX); % cm
hTotAtPoint = S.hTotProfile(xINDEX,yINDEX,tINDEX); % microns
%%%%%%%%%%%%%%%%%%%%%%%%% - SECOND EXAMPLE - %%%%%%%%%%%%%%%%%%%%%%%%%%%
One can also make surface plots of GammaTot and hTotProfile. If one does, one
should keep in mind that the surface grid automatically generated by Matlab will
make the plot hard to read. One should instead use phong shading as follows:
% Assume one want to examine the second phase of the oscillation
tINDEX = 2;
figure();
surf( S.xGamma , S.yGamma , S.GammaTot(:,:,tINDEX) , ...
'EdgeColor' , 'none' , ...
'LineStyle' , 'none' , ...
'FaceLighting' , 'phong' );
figure();
surf( S.xh , S.yh , S.hTotProfile(:,:,tINDEX) , ...
'EdgeColor' , 'none' , ...
'LineStyle' , 'none' , ...
'FaceLighting' , 'phong' );
%%%%%%%%%%%%%%%%%%%%%%%%%% - THIRD EXAMPLE - %%%%%%%%%%%%%%%%%%%%%%%%%%%
A particularly nice way of visualizing the data is to gaussian blur the
surfactant data and then overlay it as the coloration of a surface plot of the
surface morphology data. This can be done as follows:
% Assume one want to examine the second phase of the oscillation
tINDEX = 2;
%% Gaussian blur the surfactant data
% by first build a kernel for the convolution, and then convolve the kernel with
% the data.
Kernel = fspecial('gaussian',[11 11], 2);
SmooData = conv2(S.GammaTot(:,:,tINDEX),Kernel,'same');
figure();
surf( S.xh , S.yh , S.hTotProfile(:,:,tINDEX) , SmooData , ...
'EdgeColor' , 'none' , ...
'LineStyle' , 'none' , ...
'FaceLighting' , 'phong' );
% A non-JET colormap can help
colormap summer
ColorHandle = colorbar;
% Also, labeled axes
xlabel('x (cm)');
ylabel('y (cm)');
zlabel('h (\mu m)');
ylabel(ColorHandle, '\Gamma (\Gamma_c)');
title(sprintf('\\Gamma and h fields at time %1.4f s',S.t(tINDEX)));