2个回答
展开全部
clc;clear
rho = @(r,lambda,n) pi*r./lambda*(n-1);
LBD = @(R,r)7.41*R.^(-0.0527).*(2*r).^0.452;
nr = @(R,r)2.306e5*R.^0.364.*(2*r).^0.274.*exp(-LBD(R,r));
Qr = @(r,lambda,n) 2-4./rho(r,lambda,n).*sin(rho(r,lambda,n))+...
4./rho(r,lambda,n).^2.*(1-cos(rho(r,lambda,n)));
ealpha = @(R,r,lambda,n)4343*Qr(r,lambda,n).*nr(R,r);
n = 1.33;
lambda = 1550e-6;
R = 1:0.5:100;
m = 5000;
h = (4-0.5)/m;
r = linspace(0.5,4,m+1);
[RR,rr] = meshgrid(R,r);
S = ealpha(RR,rr,lambda,n)';
% 用复化辛普森求积分
alpha = (sum(S(:,[1 end]),2)+4*sum(S(:,2:2:end-1),2)+2*sum(S(:,3:2:end-1),2))*h/3;
plot(R,alpha,'r-.','linewidth',2)
xlabel('$$\alpha$$','interpreter','latex')
ylabel('$$R$$','interpreter','latex')
set(gca,'fontsize',14)
box off
grid on
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询