Question: Language Python: A velocity field in the xy plane is given by Where: (1) (2) is a script whith a function which calculates the power

Language Python:

A velocity field in the xy plane is given by Language Python: A velocity field in the xy plane is given by Where:

Where: (1) (2) is a script whith a function which calculates the (1)

power function in the area. a)_Use the function down to plot contour (2)

lines for when: _Represent cases (i) and (ii) in their respective diagrams.

b) Write a function (filname velfield.py) that calculates velocities based on equationis a script whith a function which calculates the power function (1) at the call: _The function : from numpy import linspace, meshgrid,in the area.

a)_Use the function cos, pi def streamfun(n=20): '''Regner ut et grid og en strmfunksjon''' x=linspace(-0.5*pi,0.5*pi,n) down to plot contour lines for #resultatet er en vektor med n elementer, fra -pi/2 til pi/2 [X,Y] when:

= meshgrid(x,x) psi=cos(X)*cos(Y) return X, Y, psi Other details: = v=vi+vyj Uz

_Represent cases (i) and (ii) in their respective diagrams.

b) Write a function (filname velfield.py) that calculates velocities based on equation (1) at the call:

= cos(2) sin(y), Vy = -sin :) cos(y). U = cos(2) cos(y).

_The function Ar = Ay = n1 streamfun (i) n=5 (ii) n = 30 :

from numpy import linspace, meshgrid, cos, pi def streamfun(n=20): '''Regner ut et grid og en strmfunksjon''' x=linspace(-0.5*pi,0.5*pi,n) #resultatet er en vektor med n elementer, fra -pi/2 til pi/2 [X,Y] = meshgrid(x,x) psi=cos(X)*cos(Y) return X, Y, psi

Other details:

>> x,y,u,v=velfield(n) v=vi+vyj Uz = cos(2) sin(y), Vy = -sin :) cos(y). = U = cos(2) cos(y). Ar = Ay = n1 streamfun (i) n=5

v=vi+vyj Uz = cos(2) sin(y), Vy = -sin :) cos(y). U = cos(2) cos(y). Ar = Ay = n1 streamfun (i) n=5 (ii) n = 30 >> x,y,u,v=velfield(n) v=vi+vyj Uz = cos(2) sin(y), Vy = -sin :) cos(y). U = cos(2) cos(y). Ar = Ay = n1 streamfun (i) n=5 (ii) n = 30 >> x,y,u,v=velfield(n)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!