Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Source Potential Flow

  1. Sep 25, 2006 #1
    Hey all:

    I am trying to plot the streamlines of a source flow in MATLAB. I just have a couple issues. First, when I change the strength, it doesn't appear that the streamlines change at all. Second, the three lines commented out below, I used them from an example, but now they don't work.

    If someone could give me a hand checking this code, that would be great.

    Code:

    clear all
    close all
    clc

    nx = 100; xmin = -2; xmax = 2;
    ny = 100; ymin = -2; ymax = 2;
    [x y] = meshgrid(linspace(xmin,xmax,nx),linspace(ymin,ymax,ny));
    M = 8; xM = 0; yM = 0;
    PsiM = (M/(2*pi))*atan2(y - yM,x - xM);
    % levmin = PsiM(1,nx);
    % levmax = PsiM(ny,nx/2);
    % levels = linspace(levmin,levmax,50);
    contour(x,y,PsiM,100)
    axis([xmin xmax ymin ymax])
    xlabel('x'), ylabel('y')
    title('Source of Strength M = 4')
     
  2. jcsd
  3. Sep 26, 2006 #2
    Can anyone help me?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Source Potential Flow
Loading...