[Numpy-discussion] [ANN] NLopt, a nonlinear optimization library

Steven G. Johnson stevenj at alum.mit.edu
Tue Jun 29 13:33:02 EDT 2010


Steven G. Johnson wrote:
>> Regarding constraints, the suggestion was to "manually" substitute my
>> variables with combinations of exp()-expressions that would implicitly
>> take care of the  r_i>0 and 0<A_j<1 constraints.
>> Question: Does NLopt allow to do those optimizations in a more direct,
>> less "manual" and still easy-to-use way ?

I just noticed that the constraints you mentioned are not even 
nonlinear; they are just bound constraints on the variables.  All of the 
NLopt algorithms support bound constraints; these are relatively easy to 
include in an optimization algorithm.  (Penalty functions for bound 
constraints are definitely overkill.)

In your email, you also mentioned a constraint
	A1+A2+A3 == 1 and 0<=Ai<=1.
An equality constraint like this is much easier to handle via 
elimination.  Just set A3 = 1 - A1 - A2, eliminating the A3 parameter, 
and include inequality constraints 0 <= 1 - A1 - A2 <= 1    (this is not 
a bound constraint, so you would have to use NLopt's general 
inequality-constraint support).

Steven




More information about the NumPy-Discussion mailing list