[SciPy-user] Using scipy specfunc in integration

Neal Becker ndbecker2@gmail....
Fri Jun 13 09:21:53 CDT 2008


Any ideas on this?
from scipy.special import erf
from math import exp, tan
def cot(x):
    return 1/tan(x)

N = 8
esnodB = 10
Rd = 10**(.1 * esnodB)

def F (y):
    return exp (-(y**2)) * erf (y * cot (pi/N))


Pe = float(N-1)/float(N) - 0.5 * erf (sqrt (Rd * sin (pi/N))) - 1/(sqrt(pi))
* quadrature(F, 0, sqrt(Rd) * sin (pi/N))[0]
TypeError: only length-1 arrays can be converted to Python scalars

It seems to be complaining about erf.
erf
Out[33]: <ufunc 'erf'>




More information about the SciPy-user mailing list