# Using quiver plot，how to show the states of polarization (SoP) in vector beams

10 Ansichten (letzte 30 Tage)

Kommentiert: 明泽 am 27 Apr. 2024
As shown in the figure, I want to plot the polarization state of this radial or angular vector beam。
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Malay Agarwal am 23 Apr. 2024
For a radially polarized beam, the electric field vectors point away from the center of the beam. The polarization vector at any point (x, y) in the plane can be represented as:
Similarly, for an angularly polarized beam, the electric field vectors are tangential to circles centered on the beam axis. The polarization vector at any point (x, y) can be represented as:
Given this information, the SOPs can be plotted as follows:
% Parameters
% TODO: Replace with your data for the vector beam
gridSize = 20; % Size of the grid
[X, Y] = meshgrid(linspace(-1, 1, gridSize), linspace(-1, 1, gridSize));
% Radial polarization vectors
Ex_r = X ./ sqrt(X.^2 + Y.^2);
Ey_r = Y ./ sqrt(X.^2 + Y.^2);
% Azimuthal polarization vectors
Ex_a = -Y ./ sqrt(X.^2 + Y.^2);
Ey_a = X ./ sqrt(X.^2 + Y.^2);
% Handling the singularity at (0,0)
Ex_r(isnan(Ex_r)) = 0;
Ey_r(isnan(Ey_r)) = 0;
Ex_a(isnan(Ex_a)) = 0;
Ey_a(isnan(Ey_a)) = 0;
intensityImage = getIntensityImage(X, Y, gridSize, 0.5);
subplot(1,2,1);
imagesc(unique(X), unique(Y), intensityImage, 'interp', 'bilinear');
hold on;
quiver(X, Y, Ex_r, Ey_r, 0.5, "filled", "Color", "black");
axis equal;
hold off;
title('Radial Polarization');
subplot(1,2,2);
imagesc(unique(X), unique(Y), intensityImage, 'interp', 'bilinear');
hold on;
quiver(X, Y, Ex_a, Ey_a, 0.5, "filled", "Color", "black");
axis equal;
hold off;
title('Angular Polarization');
function image = getIntensityImage(X, Y, gridSize, sigma)
% Get intensity at each (x, y) point
I = exp(-((X.^2 + Y.^2) / (2 * sigma^2)));
% Normalize the intensity to be between 0 and 1
I_normalized = (I - min(I(:))) / (max(I(:)) - min(I(:)));
% Choose a colormap
cmap = colormap(parula(256)); % Using 'parula' colormap with 256 colors
% Map the normalized intensity values to indices in the colormap
I_mapped = round(I_normalized * 255) + 1; % Scale and shift indices to 1-256
% Initialize an RGB image
image = zeros(gridSize, gridSize, 3);
% Assign RGB values for each point
for i = 1:gridSize
for j = 1:gridSize
image(i, j, :) = cmap(I_mapped(i, j), :);
end
end
end
The code:
• Generates the (x, y) coordinates for the vector beam. Please replace this with data for your vector beam.
• Creates the radial and angular polarization vectors.
• Creates an intensity map for the vector beam using the function “getIntensityImage”.
• Uses “subplot” with the “hold” command to plot the intensity map and overlay the radial and angular polarization states on the map.
Please refer to the following resources for more information:
Hope this helps!
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Thank you very much for your help

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Vector Volume Data 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