0

I don't know if this question is in the right place or not, if not, please tell me. So, I'm using python and I have to optimize a cost function which has two constraints. This cost function is non-increasing w.r.t. production quantity, so it is optimal to order as less as possible. However, my constraints put lower and upper bounds on the production quantity. It can be argued that hence in this case the lower bound will be binding.

But now, I also computed the lower and upperbounds by hand, and in some cases the lower bound is greater than the upper bound in value...

I use scipy.optimize.minimize and method SLSQP and I have understood that the inequality constraints are such that they are non negative. So I entered production quantity - lower bound as a constraint, and upper bound - production quantity (these should be non-negative).

When executing, I get as answers the lowest possible value, as argued before. However, sometimes this lowest possible value is given by the upper bound?? And therefore, the two constraints both also do not hold, since lower > upper. However I get no error, all the time it is able to find the solutions? How is this possible? And how can the lower bound be greater than the upper bound

pk_22
  • 288
  • 1
  • 2
  • 18
  • Your problem description makes no sense to me. But if you have theory that says production should equal a certain value, why not impose that constraint directly? – Alan Apr 23 '16 at 12:43
  • Yes in this case that could be. I have a sequence of production quantities etc, since I have more time periods. At some periods, the lowest possible value for the production quantity is given by the lower bound (which sould be), and sometimes it is given by the upper bound (which makes no sense?, since this implies that the upper bound I'm imposing is lower than the lower bound), but at least it picks the lowest value.. – pk_22 Apr 23 '16 at 13:07
  • I want to extend the problem where I have convex costs, so the optimal solution may be between the bounds, and the lower bound (or in my case he lowest value) does not have to be binding. But how is it even possible that my upper bound is lower than the lower bound, but scipy minimize still finds the corrects answer, since the constraints are not met in this case? – pk_22 Apr 23 '16 at 13:08
  • Because it does not guard against your passing bad bounds. I agree it should. Instead it simply does this: https://github.com/scipy/scipy/commit/1c16c599f7aa13e2ad25d5e84bd284bd5cae3d10 – Alan Apr 23 '16 at 14:52
  • I did not enter them as bounds but as constraints, so you suggest that I should pass them as bounds? – pk_22 Apr 24 '16 at 08:44

0 Answers0