求助!!!积分积不出
clearclc
close all
n1=1.33;n2=1.6;
s=linspace(0,1.4,700);
nn=0;
Qg=[];
for i=1:length(s)
theta=0.1:0.1:70;
a=theta*pi/180;
r=asin(n1/n2*sin(a));%折射角r
rp=(n2*cos(a)-n1*sqrt(1-(n1/n2*sin(a)).^2))./...
(n2*cos(a)+n1*sqrt(1-(n1/n2*sin(a)).^2));%反射率p分量
rs=(n1*cos(a)-n2*sqrt(1-(n1/n2*sin(a)).^2))./...
(n1*cos(a)+n2*sqrt(1-(n1/n2*sin(a)).^2));%反射率s分量
tp=2*n1*cos(a)./(n2*cos(a)+n1*sqrt(1-(n1/n2*sin(a)).^2));%透射率p分量
ts=2*n1*cos(a)./(n1*cos(a)+n2*sqrt(1-(n1/n2*sin(a)).^2));%透射率s分量
R=(abs(rp).^2+abs(rs).^2)/2;
T=1-R;%给T赋值
ss=s(i);
Q1=(2*cos(a)./((1-(sin(a).^2)./ss.^2).*sin(a))).*...
(R.*sin(2*a)-(T.^2.*(sin(2*a-2*r)+R.*sin(2*a))./(1+R.^2+2*R.*cos(2*r))));
Qg(i)=trapz(a,Q1);
end
figure(1)
plot(a,Q1)
hold on
figure(2)
plot(s,Qg)
页:
[1]