我想问一下如何用python计算这个积分
enter image description here
from scipy import integrate
Hight_above_ground = 2.5
surface_ground = 81
surface_collector = 65
f = (np.cos(tilt)*np.cos(tilt)) / (PI * s**2 )
(1/surface_ground) * integrate.dblquad(f, 0, surface_ground, 0, surface_collector)
注意:A1和A2是2个曲面区域A1是曲面接地,A2是曲面收集器
这是给定的误差
Traceback (most recent call last):
File "Bifacial_systems.py", line 34, in <module>
(1/surface_ground)*integrate.dblquad(f, 0, surface_ground, 0, surface_collector)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 602, in dblquad
opts={"epsabs": epsabs, "epsrel": epsrel})
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 826, in nquad
return _NQuad(func, ranges, opts, full_output).integrate(*args)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 881, in integrate
**opt)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 352, in quad
points)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 463, in _quad
return _quadpack._qagse(func,a,b,args,full_output,epsabs,epsrel,limit)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 881, in integrate
**opt)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 352, in quad
points)
File "C:\Users\S1-DEV-Manel\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\integrate\quadpack.py", line 463, in _quad
return _quadpack._qagse(func,a,b,args,full_output,epsabs,epsrel,limit)
ValueError: invalid callable given
1条答案
按热度按时间5hcedyr01#
你必须重写你的被积函数,使
dA1
和dA2
的表达式用theta1
,theta2
,d theta1
和d theta2
来表示。假设dA1 dA2 = d theta1 d theta2
的解为如果最终得到的是高阶积分,可以使用nquad