image thumbnail
from Kirchhoff Vortex Contour Dynamics Simulation by Travis Mitchell
Contour dynamics simulation of an elliptical vortex in 2D inviscid and incompressible flow

LoadExpData(S1)
function out_vec = LoadExpData(S1)
%  Version: 1.0, 19 March 2008
%
% reads experimental data loaded into contours.dat and time.dat files
            
exp_head            = S1.exp_head;
exp_scale_factor    = S1.exp_scale_factor;
n_ellipse_points    = S1.n_ellipse_points;

fid = fopen([exp_head,'contours.dat'], 'r');
a = fscanf(fid, '%f ', [3000  inf]);
fclose(fid);
n_points = size(a,2) ;
fid = fopen([exp_head,'times.dat'], 'r');
T = fscanf(fid, '%f ', [n_points]);    
fclose(fid);          

for i_load = 1:2:n_points
    index = find(a(:,i_load) > -500);
    x = a(index,i_load) ./ exp_scale_factor;
    y = a(index,i_load+1) ./ exp_scale_factor;
    x = [x.' x(1)];
    y = [y.' y(1)]; 
    N = n_ellipse_points + 1;
    p = [x',y'];
    q = curvspace(p,N);
    x = q(1:end-1,1).';
    y = q(1:end-1,2).';
    hold off
    plot(x,y)
    xlim([-1.1 1.1]);
    ylim([-1.1 1.1]);
    drawnow
    if i_load == 1      
        Z0_start = (x + i * y);  
        Y_Love = Z0_start.';
    else
        Y_Love = [Y_Love,(x + i * y).'];
    end
    if i_load == 1
        hold on
    end
end
    Y_Love = Y_Love.';
    out_vec = [T Y_Love];

Contact us at files@mathworks.com