[SciPy-user] [OpenOpt] lb issue

Emanuele Olivetti emanuele@relativita....
Sat Jun 28 08:46:50 CDT 2008


Dear all and dear Dmitrey,

I experience problems when setting lower bounds (lb) to
a non-linear problem. I have a simple bound for x: being
bigger than zero.

Here follows a simple example that shows the issue: even though
I set "lb=N.zeros(dimensions)", the "ralg" solver tries to compute
f() when x<0. Why?
----
import numpy as N
from scikits.openopt import NLP

size = 100
dimensions = 2
data = N.random.rand(size,dimensions)-0.5

def f(x):
    global data
    if (x<0).sum()>0:
        print "WARNING! Lower bound exceeded, x =",x
        pass
    return N.dot(data**2,x.T)

x0 = N.ones(dimensions)
p = NLP(f,x0,lb=N.zeros(dimensions),ftol=1.0e-3)
p.solve("ralg")
print p.ff,p.xf
----

I'm wondering if I've understood correctly how to use
p.lb. Any explanation will be very appreciated.

Emanuele


P.S.: OpenOpt updated from SVN, NumPy v1.0.3 and SciPy v0.5.2
provided by Ubuntu Gutsy 7.10.



More information about the SciPy-user mailing list