python matlab 普朗克公式黑体光谱辐射出射度 绘图

公式

普兰克公式

python程序

import numpy as np 
import matplotlib.pyplot as plt 
#------------------------------------------------------------------------
#计算500K和800K黑体的光谱辐射出射度
def planck_formula(wavelength,      #波长
                   temperature,     #温度
                   c1=3.7414*10**8, #c1常量
                   c2=1.43879*10**4 #c2常量
                    ):
    return (c1/wavelength**5)*(1/(np.e**(c2/wavelength/temperature)-1))
#得到取样点以及输出取样点对应的值
wavelength_limit = np.linspace(0.001,100,100000)
out_500 = planck_formula(wavelength_limit,500)
out_800 = planck_formula(wavelength_limit,800)
plot_500 = plt.plot(wavelength_limit,out_500,label='500K')
plot_800 = plt.plot(wavelength_limit,out_800,label='800K')
#绘图
plt.xlim(0,20)
plt.ylim(0,8000)
plt.xlabel('wavelength: μm')
plt.ylabel('spectral radiant emission: w/(cm^2 * μm)')
plt.title('Blackbody spectral radiant emission curve:')
plt.legend()
plt.show()
#------------------------------------------------------------------------

结果

在这里插入图片描述

matlab程序

function IRwork1()
    function  emission = planck_formula(wavelength,temperature)
        c1=3.7414*10^8;
        c2=1.43879*10^4;
        emission = (c1./(wavelength().^5)).*(1./(exp(c2./wavelength./temperature)-1));
    end
wavelength = 0.1:0.01:25;
out_500 = planck_formula(wavelength,500);
out_800 = planck_formula(wavelength,800);
plot(wavelength,out_500);
hold on;
plot(wavelength,out_800);
title('Blackbody spectral radiant emission curve:');

end

结果

在这里插入图片描述

评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值