I need help to create a circular vortex with different polarizations like converging, diverging and clockwise etc.,
I attached an image for reference.

댓글 수: 2

Dyuman Joshi
Dyuman Joshi 2023년 7월 24일
Please show what you have attempted yet.
% Parameters
numPoints = 100; % Number of points in the vortex
spinMagnitude = 0.5; % Magnitude of the spin vectors
radius = 1; % Radius of the vortex
% Generate theta values
theta = linspace(0, 2*pi, numPoints);
% Generate x and y coordinates
x = radius * cos(theta);
y = radius * sin(theta);
% Generate spin vectors
spinVectors = spinMagnitude * ones(size(x));
% Plot the vortex
figure;
quiver(x, y, spinVectors.*cos(theta), spinVectors.*sin(theta), 'b');
axis equal;
title('Circular Diverging Vortex');
xlabel('X');
ylabel('Y');

댓글을 달려면 로그인하십시오.

답변 (2개)

Dyuman Joshi
Dyuman Joshi 2023년 7월 24일

1 개 추천

% Parameters
numPoints = 50; % Number of points in the vortex
spinMagnitude = 0.5; % Magnitude of the spin vectors
r1 = 1; % Radius of the outer vortex
r2 = 0.5; %Radius of the inner vortex
% Generate theta values
theta = linspace(0, 2*pi, numPoints);
% Generate x and y coordinates
x = cos(theta);
y = sin(theta);
% Generate spin vectors
spinVectors = spinMagnitude * ones(size(x));
%%Radially outward arrows
figure;
quiver(r1*x, r1*y, spinVectors.*x, spinVectors.*y, 'b');
hold on
quiver(r2*x, r2*y, spinVectors.*x, spinVectors.*y, 'b');
axis equal;
xlabel('X');
ylabel('Y');
%%Radially outward arrows leaning in a counter clockwise direction
figure
quiver(r1*(x+y), r1*(y-x), spinVectors.*x, spinVectors.*y, 'b');
hold on
quiver(r2*(x+y), r2*(y-x), spinVectors.*x, spinVectors.*y, 'b');
axis equal;
xlabel('X');
ylabel('Y');

댓글 수: 4

In case you want Radially outward arrows which are leaning clockwise, try this -
% Parameters
numPoints = 50; % Number of points in the vortex
spinMagnitude = 0.5; % Magnitude of the spin vectors
r1 = 1; % Radius of the outer vortex
r2 = 0.5; %Radius of the inner vortex
% Generate theta values
theta = linspace(0, 2*pi, numPoints);
% Generate x and y coordinates
x = cos(theta);
y = sin(theta);
% Generate spin vectors
spinVectors = spinMagnitude * ones(size(x));
%%Radially outward arrows leaning in a clockwise direction
figure
quiver(r1*(x-y), r1*(x+y), spinVectors.*x, spinVectors.*y, 'b');
hold on
quiver(r2*(x-y), r2*(x+y), spinVectors.*x, spinVectors.*y, 'b');
axis equal;
xlabel('X');
ylabel('Y');
Sateesh Kandukuri
Sateesh Kandukuri 2023년 7월 28일
Dear @Dyuman Joshi, thank you so much for your response. Actually, I am looking for a pattern something like as below.
Let's consider a 200-unit dia circular geometry with a unit vector spacing. I want to define my base geometry with normalized spin vectors with different in-plane possible orientations. Could you please help me in this wasy?
Dyuman Joshi
Dyuman Joshi 2023년 7월 31일
Do you only have these images to work with? or do you have any data or any other piece of information?
Sateesh Kandukuri
Sateesh Kandukuri 2023년 7월 31일
Actually, the polarization of the system is defined by P = (cosφ, sinφ, 0), where φ = tan-1(y/x) +Ψ and (x,y) are the spatial coordinates in the system plane with the origin at the centre. The angle Ψ determines the polarization orientation. For Ψ = 0, it gives diverging vortex. I hope this piece of information helpful.

댓글을 달려면 로그인하십시오.

Bruno Luong
Bruno Luong 2023년 7월 31일
편집: Bruno Luong 2023년 7월 31일

1 개 추천

[x,y] = ndgrid(linspace(-1,1,10));
x = x(:)';
y = y(:)';
xy = [x; y];
r = vecnorm(xy, 2, 1);
r(r > 1) = NaN;
xyn = xy ./ r;
for k=1:12
Psi = 2*pi*rand();
R = [cos(Psi), -sin(Psi);
sin(Psi), cos(Psi)];
V = R * xyn;
vx = V(1,:);
vy = V(2,:);
subplot(3,4,k);
quiver(x, y, vx, vy, 'linewidth', 2);
set(gca, 'visible', 'off')
end

댓글 수: 2

Sateesh Kandukuri
Sateesh Kandukuri 2023년 7월 31일
Dear @Bruno Luong, I want to define these normalized spin vectors on a 200-unit diameter circular geometry with a unit vector spacing, and I need it in a separate image based on the angle Psi.
Bruno Luong
Bruno Luong 2023년 7월 31일
편집: Bruno Luong 2023년 7월 31일
Feel free to adapt my code to your need.
I gave you a recipe of the cake, if you want strawberry flavor, you need to adapt my recipe and make your own cake.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Polar Plots에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2023년 7월 24일

편집:

2023년 7월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by