clcclear allclose allVo= 10;Po = 101000;rho = 1.225;R =1;x = linspace(-4,4,1000);y = linspace(-4,4,1000);[X,Y] = meshgrid(x,y);r = sqrt(x.^2 +y.^2);theta = atan(y/x);Vr = 1-((R^2)./(r.^2)).*Vo.*cos(theta); Vt = -(1- (R^2./r.^2).*Vo.*sin(theta)); Vx = (Vr.*cos(theta) - Vt.*sin(theta)); Vy = (Vr.*sin(theta) - Vt.*cos(theta));P = 5.*rho.*(Vo^2 - Vx.^2 - Vy.^2)+ Po;figurepcolor(X,Y,hypot(Vx,Vy))shading interph=streamline(X,Y,Vx,Vy);set(h,'color','red')
MATLAB: I’m trying to take the grid points x and y and the velocities Vx and Vy to plot the streamlines using streamline starting at x = −4 and 21 and y locations between -4 and 4.
streamlines
Best Answer