how to plot the state of polarisation distribution of a c or v point polarisation singularity using quiver plots

15 visualizaciones (últimos 30 días)
How to plot this state of polarisation distribution using quiver plots for a c point or v point polarisation singularity. Anyone please help.

Respuesta aceptada

Milan Bansal
Milan Bansal el 28 de Mayo de 2024
Editada: Milan Bansal el 29 de Mayo de 2024
Hi Aswathi K,
I understand that you want to plot the ellipses as shown in the image using the quiver plot for a c-point or v-point polarization singularity.
The quiver plot in MATLAB plots arrows with specified directional components at the specified Cartesian coordinates. It cannot plot the directional ellipses. However, for a workaround, you can refer to the following steps and the code snippet given below to plot the ellipses for a c-point polarization singularity:
  1. Define the grid: Create a grid of points where you want to plot the polarization ellipses.
  2. Calculate the ellipse parameters: For each point on the grid, calculate the parameters of the polarization ellipse (orientation, major and minor axes).
  3. Plot the ellipses: Use the plot function to draw ellipses at each grid point.
% Define the grid
[x, y] = meshgrid(-10:1:10, -10:1:10);
% Radius of the circular region
R = 10;
% Create a figure
figure;
hold on;
axis equal;
axis off;
% Define the number of points for plotting ellipses
num_points = 50;
t = linspace(0, 2*pi, num_points);
% Loop through each grid point
for i = 1:numel(x)
% Coordinates
xi = x(i);
yi = y(i);
% Only plot ellipses within the circular region
if sqrt(xi^2 + yi^2) <= R
theta = atan2(yi, xi) / 2; % Orientation of the ellipse
a = 1 - 0.05 * sqrt(xi^2 + yi^2); % Major axis length
b = 0.2 * abs(sin(2*theta)); % Minor axis length
% Parametric equation of the ellipse
X = a * cos(t);
Y = b * sin(t);
% Rotate the ellipse by angle theta
R_matrix = [cos(theta) -sin(theta); sin(theta) cos(theta)];
ellipse = R_matrix * [X; Y];
% Plot the ellipse at the point (xi, yi)
plot(xi + ellipse(1, :), yi + ellipse(2, :), 'r', 'LineWidth', 1);
end
end
% Plot the circular boundary
theta_boundary = linspace(0, 2*pi, num_points);
plot(R * cos(theta_boundary), R * sin(theta_boundary), 'k', 'LineWidth', 2);
Please refer to the following documentation link to learn more about quiver function.
Hope this helps!
  3 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by