% % w06conf.m -- (djm: 11 feb 2004) % % initialize workspace clear; %close all % set x & y-vectors & grid matrices ("help meshgrid") L = 4.0; ds = 2*L/101; x = -L:ds:+L; y = -L:ds:+L; [xx,yy] = meshgrid(x,y); zz = xx + i*yy; rr2 = xx.^2 + yy.^2; % flow around cylinder Phi = (zz + 1./zz); % plot level curves of Phi in z-plane figure(1); clf subplot(2,2,1); hold on axis([-1 1 -1 1]*L); grid on; axis square title('\bf z-plane') contour(x,y,real(Phi),[-2.0:0.5:2.0],'g--') contour(x,y,imag(Phi),[-1.5:0.5:1.5],'k--') th=0:2*pi/100:2*pi; fill(cos(th),sin(th),'w') plot(cos(th),sin(th),'m','linewidth',2) plot(1,0,'rx') plot(-1,0,'ro') plot(0,1,'bx') plot(0,-1,'bo') plot(0,(1+sqrt(5))/2,'b*') % plot Phi-plane subplot(2,2,2); hold on axis([-1 1 -1 1]*L); grid on; axis square title('\bf \Phi-plane') contour(x,y,real(zz),[-2.0:0.5:2.0],'g--') contour(x,y,imag(zz),[-1.5:0.5:1.5],'k--') contour(x,y,imag(zz),[0 0],'k') plot([-2 2],[0 0],'m','linewidth',2) plot(2,0,'rx') plot(-2,0,'ro') plot(0,0,'bx') plot(0,0,'bo') plot(0,1,'b*')