How to plot streamline for velocity data??

40 Ansichten (letzte 30 Tage)
Turbulence Analysis
Turbulence Analysis am 16 Feb. 2021
Beantwortet: darova am 16 Feb. 2021
Hi,
I need to plot velocity vectors along with streamline. For velocity vectors, I have used quiver() as shown below which works properly, please let me know how to plot streamlines.. I have attached velocity data for your reference.. Please help me with this..
skip=2;
ff=quiver(x',y(1:skip:end),Um(1:skip:end,:),Vm(1:skip:end,:));

Antworten (2)

KSSV
KSSV am 16 Feb. 2021
  1 Kommentar
Turbulence Analysis
Turbulence Analysis am 16 Feb. 2021
Hi,
Thanks. I have used as follows, but not getting the proper streamline.. I guess, I am not defining startx, starty in a correct way..
skip=2;
ff=quiver(x',y(1:skip:end),Um(1:skip:end,:),Vm(1:skip:end,:));
ff.Color='black';
ff.AutoScaleFactor=12;
set(gca, 'YDir','normal')
startx = -40:40;
starty = 0:80;
streamline(x,y,Um,Vm,startx,starty);

Melden Sie sich an, um zu kommentieren.


darova
darova am 16 Feb. 2021
try this
clc,clear
[x,y,z] = peaks(20); % some data
[u,v] = gradient(z); % create direction vectors
t = linspace(0,2*pi,5);
[sx,sy] = pol2cart(t,2); % start position (circle)
h = streamline(x,y,u,v,sx,sy); % display streamlines
hold on
for i = 1:length(h) % loop through all streamlines
x1 = get(h(i),'xdata'); % get data
y1 = get(h(i),'ydata');
% u and v vector fields are known
u1 = interp2(x,y,u,x1,y1); % interpolate vector field at streamline position
v1 = interp2(x,y,v,x1,y1);
quiver(x1,y1,u1,v1)
end
hold off

Kategorien

Mehr zu Vector Fields finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by