Created
August 28, 2015 19:32
-
-
Save mick001/6ef0da8d76b66ccfee58 to your computer and use it in GitHub Desktop.
Complex functions and flow around a cylinder part 2 (matlab). Full article available at: http://www.firsttimeprogrammer.blogspot.com/2015/07/complex-functions-and-flow-around.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%Gradient and flow | |
figure | |
subplot(1,2,1); | |
[Dx, Dy] = gradient(real(z)); | |
Dx(isinf(Dx)) = 0; | |
Dy(isinf(Dy)) = 0; | |
hQuiver = quiver(x,y1,Dx,Dy,'LineWidth',1); hold on; | |
viscircles([0 0],1,'LineWidth',1); hold off; | |
title('u(x,y) gradient, vector field'); | |
%%Imaginary part | |
subplot(1,2,2) | |
contour(x,y1,imag(z),linspace(-10,10,100)); title('Contour of Im(f)'); | |
hold on; | |
viscircles([0 0],1,'LineWidth',1); hold off; | |
xlabel('x'); ylabel('y'); %clabel(C3); | |
title('Imaginary part'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment