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

dZdt(Z,s,zeta)
function U = dZdt(Z,s,zeta)
%  Version: 1.0, 19 March 2008
%
%  Implementation of Eq. 28 of paper

ds = s(2)-s(1);
Z = Z.';
U = zeros(1,length(Z));

tmp = [Z(end) Z Z(1)];
dZds = (tmp(3:length(Z)+2) - tmp(1:length(Z)))/2/ds;

for k=1:length(Z)
    tmp2 = (Z-Z(k))./conj(Z-Z(k));
    % Remove the self-induction term.
    tmp2 =      tmp2([1:k-1 k+1:length(Z)]);
    tmp3 = conj(dZds([1:k-1 k+1:length(Z)]));  
    U(k) = sum(tmp2.*tmp3)*ds;
end

U = U(:) * zeta / (4 * pi);            

Contact us at files@mathworks.com