interval = 0.05; xmin = -5.0001; xmax = 5; ymin = -5.0001; ymax = 5; [x,y] = meshgrid (xmin:interval:xmax, ymin:interval:ymax); U = 1; a = 1; %GAMMA = 100; %singularitets-drap cutoff = 10; clear F %Vi er late og gidder ikke gjøre om formel fra polare koordinater r = sqrt ((x.*x) + (y.*y)); tetha = atan2 (y, x); frameindex = 1; for t = 5:0.1:20 GAMMA = t psi = U.*(-r + (a.*a)./r).*sin(tetha) - (GAMMA/(2*pi)).*log(r./a); %Drep singulariteten! for j = 1:((ymax-ymin)*(1/interval)) %y-pos for i = 1:((xmax-xmin)*(1/interval)) %x-pos if psi(j,i) > cutoff psi(j,i) = cutoff; end if psi(j,i) < -cutoff psi(j,i) = -cutoff; end end end contour (x,y,psi,30) hold on if GAMMA > 4*pi*U*a rs = (1 + sqrt(1 - (4*pi*U*a/GAMMA)^2))*GAMMA/(4*pi*U*a); else rs = a; end psis = -U*(-rs + (a*a)/rs) - (GAMMA/(2*pi))*log(rs/a) contour (x,y,psi,[0, psis],'k')%,'LineWidth',2) % contour (x,y,psi,[0],'LineWidth',2) text(-4,4, sprintf('GAMMA/4*pi*a*U = %f', GAMMA/(4*pi*a*U))); hold off F(frameindex) = getframe; frameindex = frameindex + 1; end 'Nå kan du kjøre movie(F,antallganger,FPS)'