Velocityfield and stream function

  • Thread starter Thread starter MaxManus
  • Start date Start date
  • Tags Tags
    Function Stream
AI Thread Summary
The discussion centers on calculating the velocity field from a given stream function using MATLAB. The velocity field is defined as v = ui + vj, with specific equations for u and v based on cosine and sine functions. The user attempts to compute the velocity numerically using the gradient of the stream function but encounters discrepancies between the expected and actual results. Clarification is sought on the definition of stream vectors and their representation as arrows indicating magnitude and direction. The conversation emphasizes the relationship between the stream function and the velocity field in fluid dynamics.
MaxManus
Messages
268
Reaction score
1

Homework Statement


A velocity field is given by v = ui + vj
where:
u = cos(x)sin(y)
v = -sin(x)cos(y)
x = y = [-pi/2,pi/2]


the stream function psi is:

psi = cos(x)cos(y)

Matlab function:
--------------------------------------
function[X,Y,psi] = streamfun(n)

if nargin < 1;
n=20;
end

x=linspace(-0.5*pi,0.5*pi,n);
[X,Y] = meshgrid(x,x);
psi=cos(X).*cos(Y);

------------------------------------------

Homework Equations




calculate the velocity numerically with \nablapsi


The Attempt at a Solution


I am starting with the assumption, the velocity is \nablapsi, is this correct?

--------------------------------------

[x,y,psi] = streamfun(20)
[u,v] = gratient(20)

quiver(x,y,u,v)

and I get numfield.jpg, see attachment, but this is not the same as my velocityfield.jpg

which I got from:

-----------------------------------------------
x = linspace(-0.5*pi,0.5*pi,n);
[x,y] = meshgrid(x,x);

u = cos(x).*sin(y);
v = -sin(x).*cos(y);

quiver(x,y,u,v)
----------------------------------------------------------
Can someone please help me and tell me what I am doing wronge.

Edit:
nabla*psi = -sin(x)cos(y)i - cos(x)*sin(y)j
 

Attachments

  • numfield.jpg
    numfield.jpg
    37.8 KB · Views: 483
  • velocityfield.jpg
    velocityfield.jpg
    37.6 KB · Views: 458
Last edited:
Physics news on Phys.org
One more question:

A velocity field is given by v = ui + vj
where:
u = cos(x)sin(y)
v = -sin(x)cos(y)

Draw stream vectors along the x and y axes.

What is a stream vector?
Is it just like arrows with magnitude and direction v?
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...
Back
Top