[SciPy-user] [OpenOpt] lb issue

dmitrey dmitrey.kroshko@scipy....
Sat Jun 28 13:49:10 CDT 2008

Hi Emanuele,

I could propose you temporary solution (see below), this one doesn't 
require updating oo from svn. However, usually ALGENCAN, ipopt and 
scipy_slsqp work much better for box-bound constrained problems (w/o 
other constraints) than current ralg implementation.

import numpy as N
from scikits.openopt import NLP
from numpy import any, inf
size = 100
dimensions = 2
data = N.random.rand(size,dimensions)-0.5

contol = 1e-6
lb=N.zeros(dimensions) + contol

def f(x):
    global data
    if any(x<0):
        #objective function is not defined here, let's use inf instead
        #however, some iters will show objFunVa= inf in text output
        # and graphic output is currently unavailable for the case
        return inf
    return N.dot(data**2,x.T)

x0 = N.ones(dimensions)
p = NLP(f,x0,lb=lb, contol = contol)
print p.ff,p.xf

More information about the SciPy-user mailing list