%	Irrotational, solenoidal flow in 2-D in the complex plane
%	w(z)=(1/2pi)log(z), line source
%	Domain is between theta = 0 and theta = 2pi for all r > 0
clear all
clf reset
[th,r]=meshgrid((0:10:360)*pi/180,eps:.02:1);
[x,y]=pol2cart(th,r);
z=x+i*y;
w=z;
theta=angle(z);
tsize=size(theta);
for j=1:(tsize(1)*tsize(2))
   if theta(j)<0 
      theta(j)=2*pi+theta(j);
   end
end
w=(1/(2*pi)).*(log(abs(z))+i.*theta);
contour(x,y,real(w),50,'r')
hold on
contour(x,y,imag(w),13,'k')
plot([0 1],[0 0],'k')
axis image
xlabel('x')
ylabel('y')
title('Potentials and Streamlines for w(z)=(1/2pi)log(z)')