我想在python中做一个双积分。从http://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html 获得帮助,我做了以下
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
def func(x,a):
return a*x*x
def integrl(a):
return integrate.quad(func,0,10,args=(a))
print integrate.quad(lambda x: integrl(x),0,1)
但我收到以下错误
Traceback (most recent call last):
File "test.py", line 12, in <module>
print integrate.quad(lambda x: integrl(x),0,1)
File "/usr/lib/python2.7/dist-packages/scipy/integrate/quadpack.py", line 245, in quad
retval = _quad(func,a,b,args,full_output,epsabs,epsrel,limit,points)
File "/usr/lib/python2.7/dist-packages/scipy/integrate/quadpack.py", line 309, in _quad
return _quadpack._qagse(func,a,b,args,full_output,epsabs,epsrel,limit)
quadpack.error: Supplied function does not return a valid float.
我该怎么办?