代码文件及结果文件https://download.csdn.net/download/weixin_44711096/13184056
一、要求
用matlab编码实现普朗克定律公式,并显示如下结果。
二、普朗克公式
**Planck定律:**揭示不同温度下黑体的光谱辐射强度按波长分布的规律 :
三、代码实现
1、普朗克公式
%plk.m文件
% 利用普朗克公式,计算黑体光谱辐射通量密度(辐射出射度)
function M = plk(x,T)
% x:波长um
% T:温度K
% w:光谱辐射通量密度:w/cm2/um
c1=3.742.*1e4;
c2=1.4388.*1e4;
M = c1./((x.^5).*((exp(c2./(x.*T)))-1));
2、主程序
%--------------------------------------------
%温度不同的普朗克黑体单色辐射能力与波长的曲线
%--------------------------------------------
maxP_x=[];maxP_m=[];%存储峰值点
for T=[300,400,500,600,800,1000,1200,1500,2000,2400,3000,4000,5000,6000]% 设置辐射温度(K),500,600,800,1000,1200,1500,2000,2400,3000,4000,5000,6000
l=0.1:0.02:100; % 设置波长范围及计算步长
M=plk(l,T);
%M=(c1./(l.^5)./(exp(c2./(l.*T))-1)); % 计算指定温度光谱辐出度
loglog(l,M,'LineWidth',1.4) % 绘制光谱辐出度曲线
maxM=max(M); % 找出指定温度最大光谱辐出度
i=find(maxM==M); % 找峰值波长点
hold on
maxLentgh=0.08+0.02*i; % 找峰值波长
stem(maxLentgh,maxM,'--','filled') %画直杆图
maxP_x=[maxP_x maxLentgh];
maxP_m=[maxP_m maxM];
maxStr=['(',num2str(T),'k',',',num2str(maxLentgh),'um',',',num2str(maxM),'w/cm2/um',')'];
text(l(i+10),M(i+10),maxStr,'VerticalAlignment','baseline','HorizontalAlignment','left','fontsize',7);
hold on
end
plot(maxP_x,maxP_m) %画峰值曲线
titleStr =('黑体辐射出射度分布曲线');
title(titleStr);
set(gca,'XLim',[0.1 40])
set(gca,'YLim',[0.0008 100000])
xlabel('\lambda / \mum') % 横坐标名称及单位
ylabel('M_{b\lambda} / W\cdotcm^{-2}\cdot\mum^{-1}') % 纵坐标名称及单位