[SciPy-user] lagrange multipliers in python

dmitrey openopt@ukr....
Thu Jun 14 13:30:54 CDT 2007


afaik scipy hasn't NLP solvers with equality constraints, as well as CVXOPT.
I had seen somewhere a Python package (seems like binding to c-code) 
where rSQP had been implemented, it allows to have nonlin equality 
constraints. Try web search "python rsqp optimization solver" or "python 
sqp optimization solver"

for example visit
http://trilinos.sandia.gov/packages/moocho/
and python binding to the latter
http://trilinos.sandia.gov/packages/pytrilinos/

However, I didn't use the ones.
Another one approach is use penalty coefficients (instead of Lagrange 
multipliers) with Naum Z. Shor r-alg implemented in scikits.openopt ralg 
solver (it doesn't contain c- or f-code, BSD lic.). It can handle 
gradient/subgradient provided by user and plot graphics output for NLP 
UC ralg solver.
Currently it's unconstrained, but it allows to handle very huge 
penalties rather well.

svn co http://svn.scipy.org/svn/scikits/trunk/openopt openopt
sudo python setup.py install

from scikits.openopt import NLP
help(NLP)

however, it doesn't produce pyc-files in the site-packages directory while installation, you'd better to do it by hands now.
this is very preliminary version, only some months has been spent.


WBR, D.


fdu.xiaojf@gmail.com wrote:
> Hi all,
>
> Sorry for the cross-posting.
>
> I'm trying to find the minimum of a multivariate function F(x1, x2, ...,
> xn) subject to multiple constraints G1(x1, x2, ..., xn) = 0, G2(...) =
> 0, ..., Gm(...) = 0.
>
> The conventional way is to construct a dummy function Q,
>
> $$Q(X, \Lambda) = F(X) + \lambda_1 G1(X) + \lambda_2 G2(X) + ... + \lambda_m 
> Gm(X)$$
>
> and then calculate the value of X and \Lambda when the gradient of function Q 
> equals 0.
>
> I think this is a routine work, so I want to know if there are available
> functions in python(mainly scipy) to do this? Or maybe there is already
> a better way in python?
>
> I have googled but haven't found helpful pages.
>
> Thanks a lot.
>
> Xiao Jianfeng
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>
>
>   



More information about the SciPy-user mailing list