[SciPy-user] problem with fmin_cobyla

dmitrey openopt@ukr....
Fri Sep 7 08:05:11 CDT 2007


Josh Gottlieb wrote:
> So in the first example (I didnt re-include the second
> one here)-- see the printout from the line 'print
> iFn([6500000, 4949026, 0])' (I used the rounded
> results that the solver put out as inputs) and it
> comes up with a negative number-- violating that
> constraint...
>   
I don't know what those iFn([6500000, 4949026, 0]) means but I just add 
2 lines after
k = fmin_cobyla(...)
(here k is optimal solution obtained by cobyla)

    constraints = [allCons[i](k) for i in xrange(len(allCons))]
    print 'max v:', min(constraints)

so it prints
max v: -2.37501074363e-10

and hence all constraints are positive, as it is required by cobyla.

Regards, D.


More information about the SciPy-user mailing list