资源描述
______________________________________________________________________________________________________________
利用MATLAB,仿真偏振控制器(利用邦加球算法),验证固定偏振态到任意偏振态的转换,其结果布满整个邦加球-MATLAB simulation using polarimetric controller (with), fixed ball algorithm to any polarization transformation of polarization, and the result is full of whole nations plus the ball
clear
clc %QHQ
subplot(1,2,1)
[x,y,z]=sphere;
mesh(x,y,z);
xlabel('S1')
ylabel('S2')
zlabel('S3')
box on
colormap(bone);
hold on
%入射光
%I=[1;0;0;1]; %右旋圆偏振光(可见)
%I=[1;0;0;-1]; %左旋圆偏振光
%I=[1;1;0;0]; %水平线偏振光
%I=[1;-1;0;0]; %垂直线偏振光(可见)
%I=[1;0;1;0]; %45度线偏振光
I=[1;0;-1;0]; %-45度线偏振光(可见)
%I=[1;-0.2;-0.5;0.8994]; %某一椭圆偏振光
plot3(I(2),I(3),I(4),'*') %画出入射光的偏振态位置
%各波片的方位角
theta1=rand(1,5000)*pi-pi/2;
theta2=rand(1,5000)*pi-pi/2;
theta3=rand(1,5000)*pi-pi/2;
subplot(1,2,2)
[x,y,z]=sphere;
mesh(x,y,z);
xlabel('S1')
ylabel('S2')
zlabel('S3')
axis([-1,1,-1,1,-1,1]);
box on
colormap(bone);
%求出射光的偏振态
hold on
for i=1:5000
a=theta1(i);
b=theta2(i);
c=theta3(i);
M3=Muller(a,pi/2);
M2=Muller(b,pi);
M1=Muller(c,pi/2);
M=M3*M2*M1;
O=M*I;
O_1=O(2);
O_2=O(3);
O_3=O(4);
plot3(O_1,O_2,O_3,'r*')
hold on
end
1;
偏振控制器,利用绑架球算法对QHQ型进行方位角的误差分析
%已知输入输出,分析方位角误差
clear
clc
%I=[1;0.2;0.4;0.8944]; %采用斯托克斯方法输入的情况。
%O=[1;0;0;1];
%[I1,I2,I3]=sop_3(I);
%[O1,O2,O3]=sop_3(O);
%theta_in=atan(I2/I1);
%theta_out=atan(O2/O1);
%xi_in=asin(I3/sqrt(I1^2+I2^2+I3^2));
%xi_out=asin(O3/sqrt(O1^2+O2^2+O3^2));
theta_in=30*pi/180; %直接输入的情况。
xi_in=45*pi/180;
theta_out=135*pi/180;
xi_out=22.5*pi/180;
Delta_gamma=normrnd(0,0.005,1,1000); %正态分布 均值为0 方差为0.005
Delta_alpha=normrnd(0,0.005,1,1000);
Delta_beta=normrnd(0,0.005,1,1000);
for i=1:1000 %当波片的方位角有误差存在时,求出其所对应的偏振态
theta_3=theta_out-xi_out-Delta_alpha(i)-atan(tan(xi_in)/cos(Delta_alpha(i)))+xi_in+2*Delta_beta(i);
xi_3=-acos(sqrt(cos(Delta_alpha(i))*cos(Delta_alpha(i))*cos(xi_in)*cos(xi_in)+sin(xi_in)*sin(xi_in)));
Delta_theta(i)=1/2*(Delta_gamma(i)+atan(tan(xi_3)/cos(theta_out+Delta_gamma(i)-theta_3)));
Delta_xi(i)=1/2*(acos(sqrt(cos(theta_out+Delta_gamma(i)-theta_3)*cos(theta_out+Delta_gamma(i)-theta_3)*cos(theta_3)*cos(theta_3)+sin(theta_3)*sin(theta_3)))-xi_out);
subplot(2,3,1)
xlabel('\Delta\alpha/rad'), ylabel('\Delta\theta/rad'),
plot(Delta_alpha(i),Delta_theta(i),'r')
hold on
subplot(2,3,2)
xlabel('\Delta\beta/rad'), ylabel('\Delta\theta/rad'),
plot(Delta_beta(i),Delta_theta(i),'g')
hold on
subplot(2,3,3)
xlabel('\Delta\gamma/rad'), ylabel('\Delta\theta/rad'),
plot(Delta_gamma(i),Delta_theta(i))
hold on
subplot(2,3,4)
xlabel('\Delta\alpha/rad'), ylabel('\Delta\epsilon/rad'),
plot(Delta_alpha(i),Delta_xi(i),'r')
hold on
subplot(2,3,5)
xlabel('\Delta\beta/rad'), ylabel('\Delta\epsilon/rad'),
plot(Delta_beta(i),Delta_xi(i),'g')
hold on
subplot(2,3,6)
xlabel('\Delta\gamma/rad'), ylabel('\Delta\epsilon/rad'),
plot(Delta_gamma(i),Delta_xi(i))
hold on
end
...
偏振控制器,利用绑架球对QHQ型进行波长误差分析-Polarization...
clear
clc
%I=[1;0.2;0.4;0.8944]; %采用斯托克斯方法输入的情况。
%O=[1;0;0;1];
%[I1,I2,I3]=sop_3(I);
%[O1,O2,O3]=sop_3(O);
%theta_in=atan(I2/I1);
%theta_out=atan(O2/O1);
%xi_in=asin(I3/sqrt(I1^2+I2^2+I3^2));
%xi_out=asin(O3/sqrt(O1^2+O2^2+O3^2));
theta_in=30*pi/180; %直接输入的情况。
xi_in=45*pi/180;
theta_out=135*pi/180;
xi_out=22.5*pi/180;
Delta_gamma=normrnd(0,0.005,1,1000); %正态分布 均值为0 方差为0.005
Delta_alpha=normrnd(0,0.005,1,1000);
Delta_beta=normrnd(0,0.005,1,1000);
for i=1:1000
theta_3=theta_out-xi_out-Delta_alpha(i)-atan(tan(xi_in)/cos(Delta_alpha(i)))+xi_in+2*Delta_beta(i);
xi_3=-acos(sqrt(cos(Delta_alpha(i))*cos(Delta_alpha(i))*cos(xi_in)*cos(xi_in)+sin(xi_in)*sin(xi_in)));
Delta_theta=1/2*(Delta_gamma(i)+atan(tan(xi_3)/cos(theta_out+Delta_gamma(i)-theta_3)));
Delta_xi=1/2*(acos(sqrt(cos(theta_out+Delta_gamma(i)-theta_3)*cos(theta_out+Delta_gamma(i)-theta_3)*cos(theta_3)*cos(theta_3)+sin(theta_3)*sin(theta_3)))-xi_out);
subplot(3,2,1)
xlabel('\Delta\alpha/rad'), ylabel('\Delta\theta/rad'),
plot(Delta_alpha(i),Delta_theta,'r')
hold on
subplot(3,2,3)
xlabel('\Delta\beta/rad'), ylabel('\Delta\theta/rad'),
plot(Delta_beta(i),Delta_theta,'g')
hold on
subplot(3,2,5)
xlabel('\Delta\gamma/rad'), ylabel('\Delta\theta/rad'),
plot(Delta_gamma(i),Delta_theta)
hold on
subplot(3,2,2)
xlabel('\Delta\alpha/rad'), ylabel('\Delta\epsilon/rad'),
plot(Delta_alpha(i),Delta_xi,'r')
hold on
subplot(3,2,4)
xlabel('\Delta\beta/rad'), ylabel('\Delta\epsilon/rad'),
plot(Delta_beta(i),Delta_xi,'g')
hold on
subplot(3,2,6)
xlabel('\Delta\gamma/rad'), ylabel('\Delta\epsilon/rad'),
plot(Delta_gamma(i),Delta_xi)
hold on
end
...
figure('color','k','Position',[1 31 1280 696]);
axes1=axes('position',[0.2 0.6 0.3 0.3]);
axis( axes1,'equal');
axis(axes1,'off');
hold on
rl=1;rs=0.5;
N=30;
t1=linspace(0,2*pi,N); xl=rl*cos(t1); yl=rl*sin(t1);
t2=linspace(0,2*pi,100); xs=rs*cos(t2); ys=rs*sin(t2);
for i=1:N
plot(xl(i)+xs,yl(i)+ys);
end
axes2=axes('position',[0.5 0.6 0.3 0.3]);
axis( axes2,'equal');
axis(axes2,'off');
hold on
rl=1;rs=1;
N=30;
t1=linspace(0,2*pi,N); xl=rl*cos(t1); yl=rl*sin(t1);
t2=linspace(0,2*pi,100); xs=rs*cos(t2); ys=rs*sin(t2);
for i=1:N
plot(xl(i)+xs,yl(i)+ys);
end
axes3=axes('position',[0.35 0.20 0.3 0.3]);
axis( axes3,'equal');
axis(axes3,'off');
hold on
rl=1;rs=1.5;
N=30;
t1=linspace(0,2*pi,N); xl=rl*cos(t1); yl=rl*sin(t1);
t2=linspace(0,2*pi,100); xs=rs*cos(t2); ys=rs*sin(t2);
for i=1:N
plot(xl(i)+xs,yl(i)+ys);
end
%存脚本文件heart.m
%%一个半径为R的圆周等分成N份,然后一等分点为圆心,以等分点到该圆垂直直径
%%的距离为半径画圆。
N=90;R=1;
t0=(1:N)*2*pi/N; %%中央圆
x0=R*cos(t0);
y0=R*sin(t0);
t1=linspace(0,2*pi,100); %运动圆
X=cos(t1);
Y=sin(t1);
figure('color','k');
hold on
for i=1:N
x=x0(i)+x0(i)*X;
y=y0(i)+x0(i)*Y;
plot(x,y,'g');
end
axis equal
axis off
Welcome To
Download !!!
欢迎您的下载,资料仅供参考!
精品资料
展开阅读全文