function dxdt = v(t, x); % compute 2D inviscid cylinder velocity as function of x % input: vector x has x(1) = x coord, x(2) = y coord V0 = 1; % scale of velocity a = 1; % radius of circle % compute polar coordinates r = sqrt(x(1)^2 + x(2)^2); theta = atan2(x(2), x(1)); dxdt = [V0*(1 - (a/r)^2 * cos(2*theta)) ; -V0*(a/r)^2 * sin(2*theta)]; end