[SciPy-dev] Status: optimize.fmin_slsqp
Tue May 5 07:06:44 CDT 2009
The argument you're interested in is eqcons, which is a list of functions
whose value should be zero in a successfully optimized problem.
See the fmin_slsqp test script at
In particular, your case will be something like this
x = fmin_slsqp(testfunc,[-1.0,1.0], args = (-1.0,), eqcons = [lambda x, y:
x-x ], iprint = 2, full_output = 1)
In your case, eqcons will be:
[lambda x, y: x+x+x-1, lambda x, y: x+x+x-1 ]
Alternatively, you can write a Python function that returns those two values
in a sequence as pass it to fmin_slsqp as f_eqcons.
On Mon, May 4, 2009 at 2:00 PM, Leon Adams <firstname.lastname@example.org> wrote:
> I was wondering what the status is of the Slsqp extension to the optimize
> package. I am currently in need of the ability to place an equality
> constraint on some of my input variables, but the available documentation on
> slsqp seems insufficient.
> My Scenario:
> I have an objective fn: Obfn(x1,x2,x3,x4,x5,x6) that I would like to place
> the additional constrain of
> x1 + x2 + x3 = 1
> x4 + x5 + x6 = 1
> If there is a good usage example I can be pointed to, it would be
> Thanks in advance.
> Scipy-dev mailing list
- Rob Falck
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Scipy-dev