1 | initial version |
There are two comments in order here:
A) as you state yourself, the integrands of your expression, e.g.
U1*phi1[0]
y |--> (y - 1)*((y - 1)*(y + 1)*a12*y + (y - 1)*(y^2 + 1)*a13*y + (y - 1)*a11*y)*y
contains lots of symbolic varibles: a12,a13,a11
which are no valid floats, even after substituting a valid float for the integration variable y. That's what the error tells you ;-) . SciPy's quad has to know the numerical values of such parameters - how else could it do a numerical integral? How to supply float parameters to quad is described at http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.quad.html#scipy.integrate.quad E.g.:
f(y,a12,a13,a11)=U1*phi1[0]
quad(f,0.0,1.0,args=(1,1,1,))
(0.1261904761904762, 1.4009957215507927e-15)
B) having said that, and not knowing what your actual problem is, I however presume that the preceeding is not what you actually want, and that rather you want to set up some kind of linear equation (eq1 ?) with symbolic variables and numerically evaluated 'constants'. If that is so, I would disect the numerical integration of each of those constant off from the symbolic part of the code.