MATLAB: I need help plotting a range of stream lines in the velocity field plot.

streamline

I am new to matlab so please excuse my naivety. I need to plot streamlines for psi = [0:1:6] over the range -3<x<3. Any assistance would be greatly appreciated. Here is what I currently have;
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = 2*y; % u velocity function
v = 1+(2*x); % v velocity function
xmarker = -0.5; %stagnation 'x' point
ymarker = 0; % stagnation 'y' point
figure
hold on
quiver (x,y,u,v)
plot(xmarker,ymarker,'r*') % stagnation point
axis([-3 3 -3 3])
%stream function
psi(0) = y^2 - x^2 - x -0.25

Best Answer

Hi
Nice plotting! I believe contour might help, something like
%stream function
psi = y.^2 - x.^2 - x -0.25;
contour(x,y,psi,[0:1:6])
Cheers
Related Question