Vector plots by Quiver in MATLAB

6 visualizaciones (últimos 30 días)
Kumaresh Kumaresh
Kumaresh Kumaresh el 26 de Mzo. de 2023
Editada: Kumaresh Kumaresh el 26 de Mzo. de 2023
Hello everyone,
I created a vector plot by Glyph in Paraview (using OpenFOAM), but couldn't able to plot the same using Quiver in MATLAB.
The plot was mentioned below (Glyph images) at different times (1 hour and 10 hours). The plane locations are different: x = 0.05m for 1 hour and x = 0.20m for 10 hours, where the vectors are initiated from the plane.
In order to plot the similar results in MATLAB, I have discretized my equations clearly and coded it. When I type the command line,
quiver(x,y,u',v','AutoScaleFactor',0.2), I got the below image, which seems bit inapproriate when compared to above image.
Can someone help me, how to make it work in Matlab. I believe, I'm lagging some technique to solve by Quiver ?
Thank you

Respuestas (1)

KSSV
KSSV el 26 de Mzo. de 2023
[X,Y,Z] = peaks(100) ;
[u,v] = gradient(Z) ;
w = sqrt(u.^2+v.^2) ;
pcolor(X,Y,w) ;
shading interp ; colormap(jet);
hold on
quiver(X,Y,u,v,'k')
  1 comentario
Kumaresh Kumaresh
Kumaresh Kumaresh el 26 de Mzo. de 2023
Editada: Kumaresh Kumaresh el 26 de Mzo. de 2023
Thank you for your comments. This problem is 2D. I tried the following commands mentioned by you.
//************************//
w = sqrt(u.^2+v.^2) ;
pcolor(X,Y,w) ;
shading interp ; colormap(jet); colorbar;
hold on
quiver(X,Y,u,v,'k')
//************************//
And got the following result.
This contour image in MATLAB is similar to above image, as I mentioned using Glyph in Paraview. But the VECTOR plot is completely different. In Glyph image (mentioned top above), the velocity vectors move towards upwards (1) and left (2) directions depending upon the boundary condition setup, but in quiver plot using MATLAB, the velocity vector directed only towards left direction. That's my real concern in vector plot.
Why quiver in MATLAB not showing exact vectot plot as shown by glyph in paraview ?
Thank you

Iniciar sesión para comentar.

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by