Borrar filtros
Borrar filtros

Arrow in quiver plot does not show with change of position

5 visualizaciones (últimos 30 días)
Abhik Saha
Abhik Saha el 21 de Ag. de 2022
Comentada: Abhik Saha el 21 de Ag. de 2022
I have a program copy below that generate a quiver plot. For x1=0,y1=0. But if I change the value of the x1=0.25 or higher value with same spacing then it does not show all the points in the quiver plot. I am new to matlab. please help regarding this issue?
I am copying the code below
------------------------------------------------------------------------------
spacing = 0.1;
[x,y] = meshgrid(-1:spacing:1);
x1=0.25;y1=0;
Tau=1;
r=sqrt(x.^2+y.^2);
r1=sqrt(x1^2+y1^2);
A=0.5/pi;
U=-((A*Tau*(y-y1))./(abs(r-r1).^2));
V=((A*Tau*(x-x1))./(abs(r-r1).^2));
figure(1);clf;
plot(x,y,'ob')
hold on
plot(x1,y1,'or','linewidth',2)
quiver(x,y,U,V)
--------------------------------------------------------------------------------------

Respuestas (1)

KSSV
KSSV el 21 de Ag. de 2022
You may consider dividng the component of vector with the magnitude and plot.
spacing = 0.1;
[x,y] = meshgrid(-1:spacing:1);
x1=0.25;y1=0;
Tau=1;
r=sqrt(x.^2+y.^2);
r1=sqrt(x1^2+y1^2);
A=0.5/pi;
U=-((A*Tau*(y-y1))./(abs(r-r1).^2));
V=((A*Tau*(x-x1))./(abs(r-r1).^2));
W = sqrt(U.^2+V.^2) ;
figure(1);clf;
plot(x,y,'ob')
hold on
plot(x1,y1,'or','linewidth',2)
quiver(x,y,U./W,V./W)
  1 comentario
Abhik Saha
Abhik Saha el 21 de Ag. de 2022
Ok This works but for large values of x and y meaning that when it is close to plus/minus one then the height of the arrow should decrease to describe the behaviour. But this is missing here How can I generate this ?

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