% Happy Valentine's Day from FYFD % Written by Nicole Sharp, http://fuckyeahfluiddynamics.tumblr.com % Inputs Uinf = 1; % uniform flow strength lambda1 = 0.5; % source strength y_sp1 = 0.05; % source y-offset x_sp1 = 0; % source x-offset y_sm1 = 0; % first sink y-offset x_sm1 = 1; % first sink x-offset x_sm2 = 6; % second sink x-offset lambda2 = -0.55; % first sink strength lambda3 = -0.3; % second sink strength d = -3:0.01:3; [x,y] = meshgrid(d,d); % create grid % define streamfunction with uniform flow + two sources + two sinks stream = Uinf*y + (lambda1/2*pi)*(atan2((y-y_sp1),(x-x_sp1))+atan2((y+y_sp1),(x+x_sp1)))+(lambda2/2*pi)*atan2((y-y_sm1),(x-x_sm1))+(lambda3/2*pi)*atan2((y-y_sm1),(x-x_sm1)); figure [C,h] = contourf(y,-x,stream,11); % plot the streamlines colormap(pink); hold on contour(y,-x,stream,[0,0],'--r'); % highlight the heart-shaped streamline