[SciPy-user] problem with fmin_powell

etrade.griffiths@dsl.pipe... etrade.griffiths@dsl.pipe...
Mon Apr 27 04:49:21 CDT 2009


I am running an optimisation program using fmin_powell with the following statement:

vals = scipy.optimize.fmin_powell(my_obj.ix_func,ivalues,maxiter=my_obj.maxiter,full_output=True)

Scipy makes around 10 calls to the function my_obj.ix_func then crashes with these error messages:

Traceback (most recent call last):
  File "D:\AlunG\2008\convergence\test_script.py", line 383, in <module>
    vals = scipy.optimize.fmin_powell(my_obj.ix_func,ivalues,maxiter=my_obj.maxiter,full_output=True)
  File "C:\Python25\lib\site-packages\scipy-\scipy\optimize\optimize.py", line 1852, in 
    fval, x, direc1 = _linesearch_powell(func, x, direc1, tol=xtol*100)
  File "C:\Python25\lib\site-packages\scipy-\scipy\optimize\optimize.py", line 1737, in 
    alpha_min, fret, iter, num = brent(myfunc, full_output=1, tol=tol)
  File "C:\Python25\lib\site-packages\scipy-\scipy\optimize\optimize.py", line 1549, in 
  File "C:\Python25\lib\site-packages\scipy-\scipy\optimize\optimize.py", line 1432, in 
    tmp1 = (x-w)*(fx-fv)
TypeError: unsupported operand type(s) for -: 'str' and 'str'

I have no problems if I use fmin instead of fmin_powell.  I also tried passing the argument direc as a unit vector 
([1.,1.,1.,1.] in this case) but have the same problem.  I am using Python 2.5, SciPy 0.6, NumPy 1.5.2.  All 
suggestions gratefully received

Alun Griffiths

Visit Pipex Business: The homepage for UK Small Businesses

Go to http://www.pipex.co.uk/business-services

More information about the SciPy-user mailing list