[SciPy-user] nonlinear optimisation with constraints

Sebastian Walter sebastian.walter@gmail....
Mon Jun 22 06:54:31 CDT 2009

2009/6/22 Ernest Adrogué <eadrogue@gmx.net>:
> Hi Sebastian,
> 22/06/09 @ 09:57 (+0200), thus spake Sebastian Walter:
>> are you sure you can't reformulate the problem?
> Another approach would be to try to solve the system of
> equations resulting from equating the gradient to zero.
> Such equations are defined for all x. I have already tried
> that with fsolve(), but it only seems to find the obvious,
> useless solution of x=0. I was going to try with a
> Newton-Raphson alorithm, but since this would require the
> hessian matrix to be calculated, I'm leaving this option
> as a last resort :)

Ermmm, I don't quite get it.  You have an NLP with linear equality
constraints and box constraints.
Of course you could write down the Lagrangian for that and define an
algorithm that satisifies the first and second order optimality
But that is not going to be easy, even if you have the exact hessian:
you'll need some globalization strategy (linesearch, trust-region,...)
to guarantee global convergence
and implement something like projected gradients so you stay within
the box-constraints.

I guess it will be easier to use an existing algorithm...

And I just had a look at fmin_l_bfgs_b: how did you set the equality
constraints for this algorithm. It seems to me that this is an
unconstrained optimization algorithm which is worthless if you have a
constrained NLP.

To compute the Hessian you can always use an AD tool. There are
several available in Python.
My biased  favourite one being pyadolc (
http://github.com/b45ch1/pyadolc ) which is slowly approaching version

>> maybe you should try an interior point method. By definition, all
>> iterates will be feasible.
>> There is a python wrapper for IPOPT out there. It's called pyipopt. It
>> worked reasonably well when I tried it.
>> OPENOPT also interfaces to IPOPT as far as I know, but I have never
>> used that interface.
> Thanks, this looks interesting. I'm going to check out
> this pyipopt.
> --
> Ernest
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

More information about the SciPy-user mailing list