On Sep 21, 2013 7:40 AM, "D.YAN ESCOLAR RAMBAL" <dyeringa...@gmail.com> wrote: > > Traceback (most recent call last): > File "D:\Yan\Documents\Aptana Studio 3 Workspace\DIF1DMEDYER\SOLUCION NUMERICA PARA LA ECUACION DE LA DIFUSION EN 1D DYER", line 34, in <module> > C=(Cdifuana(M,A,D,x,tinicial)) > File "D:\Yan\Documents\Aptana Studio 3 Workspace\DIF1DMEDYER\SOLUCION NUMERICA PARA LA ECUACION DE LA DIFUSION EN 1D DYER", line 32, in Cdifuana > Cdifuana = (M/temp)*math.exp(-x**2 /(4*D*t)) > TypeError: only length-1 arrays can be converted to Python >
The math module doesn't work with numpy arrays. You should use numpy.exp() instead of math.exp(). Oscar
-- https://mail.python.org/mailman/listinfo/python-list