欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python超越函數(shù)積分運(yùn)算以及繪圖實(shí)現(xiàn)代碼

 更新時(shí)間:2019年11月20日 15:17:46   作者:Hades_Asg  
今天小編就為大家分享一篇Python超越函數(shù)積分運(yùn)算以及繪圖實(shí)現(xiàn)代碼,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

編譯環(huán)境:ubuntu17.04 Python3.5

所需庫:numpy、scipy、matplotlib

下面是理想平面的輻射強(qiáng)度計(jì)算(課程大作業(yè)~~~)

1、超越函數(shù)積分運(yùn)算

def integral(x,c1,c2,T): 
  return ((c1*0.98)/(x**5))*(1/((np.e**(c2/(x*T)))-1))

resut,err = integrate.quad(integral, 3, 5, args=(c1,c2,T))

2、繪圖實(shí)現(xiàn)

plt.figure(1) 
ax1 = plt.subplot(211)
plt.sca(ax1) 
plt.plot(fi,functionI(fi,0.5,5,1,e0),label='n=5,ks=0.5')
plt.legend(loc='upper right',bbox_to_anchor = (0.9, 0.9))
plt.xlabel(u'ψ/rad') 
plt.ylabel(u'I/(W/sr)')

ax2 = plt.subplot(212)
plt.sca(ax2) 
plt.plot(fi,functionI(fi,0.5,5,1,e0),label='n=5,ks=0.5')
plt.legend(loc='upper right',bbox_to_anchor = (0.9, 0.9))
plt.xlabel(u'ψ/rad') 
plt.ylabel(u'I/(W/sr)') 

plt.subplots_adjust(wspace=0.5, hspace=0.5) 
plt.show()

說一下plt.subplots_adjust這個(gè)函數(shù),這個(gè)是用來調(diào)整子圖之間的間距的啦

成果圖:

以上這篇Python超越函數(shù)積分運(yùn)算以及繪圖實(shí)現(xiàn)代碼就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論