溢出错误是格式不好的结果吗?
函数我尝试复制:
为课程做一个项目,我需要在其中使黑体功能并以某种方式进行操作。 我正在尝试备用方程式,在做两个方程式中,我一直克服流量错误。
这是错误消息:
alt2_2 = (1/((const_e**(freq/temp))-1))
OverflowError: (34, 'Result too large')
temp
在kelvin中给出(im使用5800作为我的测试值,因为它大约是太阳的温度)
freq
是光的速度由 在这种情况下输入的波长是什么波长,
freq = (3*(10**8))/wavelength
我都使用0.00000005
作为波长
的测试值。
和const e
是2.7182
首次使用堆栈。同样第一次自己做一个项目,任何帮助。
Function I tried to replicate:
doing a project for coursework in which I need to make the blackbody function and manipulate it in some ways.
I'm trying out alternate equations and in doing 2 of them i keep getting over flow error.
this is the error message:
alt2_2 = (1/((const_e**(freq/temp))-1))
OverflowError: (34, 'Result too large')
temp
is given in kelvin (im using 5800 as my test value as it is approximately the temp of the sun)
freq
is speed of light divided by whatever wavelength is inputted
freq = (3*(10**8))/wavelength
in this case i am using 0.00000005
as the test value for wavelength
.
and const e
is 2.7182
first time using stack. also first time doing a project on my own, any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可以使用您的值进行黑体计算。
输出:
由于我们在进来时只使用了一个或两个数字,因此结果值仅对一两个数字有效,即9.3e-08。
This does the blackbody computation with your values.
Output:
Since we only used one or two digits on the way in, the resulting value is only good to one or two digits, 9.3E-08.