左(右)旋圆偏振光、左(右)旋椭圆偏振光依次通过四分之一波片、可旋转的偏振片旋转到不同角度时后的偏振光。用matlab进行伪代码实现及代码实现
时间: 2023-12-23 17:02:34 浏览: 222
圆偏振光的后向散射旋性反转特性分析
以下是Matlab的伪代码实现:
```
%定义输入偏振光为左旋椭圆偏振光
input_polarization = 'left elliptical polarization';
%四分之一波片的逆时针旋转角度为45度
quarter_waveplate_rotation = 45;
%可旋转偏振片的逆时针旋转角度为60度
rotatable_polarizer_rotation = 60;
%根据不同的输入偏振光类型,计算出其通过四分之一波片后的偏振光类型
if strcmp(input_polarization, 'left elliptical polarization')
output_polarization = 'right circular polarization';
elseif strcmp(input_polarization, 'right elliptical polarization')
output_polarization = 'left circular polarization';
else
output_polarization = 'unknown polarization';
end
%根据四分之一波片的旋转角度,计算出其通过后的偏振光类型
if quarter_waveplate_rotation == 0
quarter_waveplate_output = input_polarization;
elseif quarter_waveplate_rotation == 45
if strcmp(input_polarization, 'left elliptical polarization')
quarter_waveplate_output = 'vertical linear polarization';
elseif strcmp(input_polarization, 'right elliptical polarization')
quarter_waveplate_output = 'horizontal linear polarization';
else
quarter_waveplate_output = 'unknown polarization';
end
else
quarter_waveplate_output = 'unknown polarization';
end
%根据可旋转偏振片的旋转角度,计算出其通过后的偏振光类型
if rotatable_polarizer_rotation == 0
rotatable_polarizer_output = quarter_waveplate_output;
elseif rotatable_polarizer_rotation == 60
if strcmp(quarter_waveplate_output, 'vertical linear polarization')
rotatable_polarizer_output = 'right elliptical polarization';
elseif strcmp(quarter_waveplate_output, 'horizontal linear polarization')
rotatable_polarizer_output = 'left elliptical polarization';
else
rotatable_polarizer_output = 'unknown polarization';
end
else
rotatable_polarizer_output = 'unknown polarization';
end
%输出最终的偏振光类型
final_output = rotatable_polarizer_output;
```
下面是完整的Matlab代码实现:
```
%定义输入偏振光为左旋椭圆偏振光
input_polarization = 'left elliptical polarization';
%四分之一波片的逆时针旋转角度为45度
quarter_waveplate_rotation = 45;
%可旋转偏振片的逆时针旋转角度为60度
rotatable_polarizer_rotation = 60;
%根据不同的输入偏振光类型,计算出其通过四分之一波片后的偏振光类型
if strcmp(input_polarization, 'left elliptical polarization')
output_polarization = 'right circular polarization';
elseif strcmp(input_polarization, 'right elliptical polarization')
output_polarization = 'left circular polarization';
else
output_polarization = 'unknown polarization';
end
%根据四分之一波片的旋转角度,计算出其通过后的偏振光类型
if quarter_waveplate_rotation == 0
quarter_waveplate_output = input_polarization;
elseif quarter_waveplate_rotation == 45
if strcmp(input_polarization, 'left elliptical polarization')
quarter_waveplate_output = 'vertical linear polarization';
elseif strcmp(input_polarization, 'right elliptical polarization')
quarter_waveplate_output = 'horizontal linear polarization';
else
quarter_waveplate_output = 'unknown polarization';
end
else
quarter_waveplate_output = 'unknown polarization';
end
%根据可旋转偏振片的旋转角度,计算出其通过后的偏振光类型
if rotatable_polarizer_rotation == 0
rotatable_polarizer_output = quarter_waveplate_output;
elseif rotatable_polarizer_rotation == 60
if strcmp(quarter_waveplate_output, 'vertical linear polarization')
rotatable_polarizer_output = 'right elliptical polarization';
elseif strcmp(quarter_waveplate_output, 'horizontal linear polarization')
rotatable_polarizer_output = 'left elliptical polarization';
else
rotatable_polarizer_output = 'unknown polarization';
end
else
rotatable_polarizer_output = 'unknown polarization';
end
%输出最终的偏振光类型
final_output = rotatable_polarizer_output;
```
阅读全文