Python Scipy Optimize with Lower bounds (instead of A_ub)
<p>I spent about 4-5 hours last night searching Stack Overflow, going through scipy optimize documents etc and could not find an answer to my problem. My question is, how do I set a lower bounds for the optimization equation when the option only seems to be for upper bound? Please see my equation and code below.</p>

<pre><code>import numpy as np
from scipy.optimize import linprog
from numpy.linalg import solve

c = np.array([4,7,5])
A = np.array([[4,1,10],[3,2,1],[0,4,5]])
b = np.array([10,12,20])

res = linprog(c,A_ub = A,b_ub = b)
print(res)
</code></pre>

<h1>minimizing (4,7,5)</h1>

<pre><code>('Optimal value:', -0.0, '\nX:', array([ 0.,  0.,  0.]))
     fun: -0.0
 message: 'Optimization terminated successfully.'
     nit: 0
   slack: array([ 10.,  12.,  20.])
  status: 0
 success: True
       x: array([ 0.,  0.,  0.])
</code></pre>

<h1>maximizing (-4,-7,-5)</h1>

<pre><code>('Optimal value:', -37.666666666666664, '\nX:', array([ 0.66666667,  5.            `    ,  0.        ]))`
     fun: -37.666666666666664
 message: 'Optimization terminated successfully.'
     nit: 2
   slack: array([ 2.33333333,  0.        ,  0.        ])
  status: 0
 success: True
       x: array([ 0.66666667,  5.        ,  0.        ])
</code></pre>

<p>It is giving me an answer in the first one to minimize x1,x2,x3 which obviously shows all zeros. The 2nd answer maximizes the function if each is &lt;=10,&lt;=12,&lt;=20 because obviously it is an upper bound. What I need is the best possible answer based on being >=10,>=12,>=20 minimizing on the function.</p>

<p>Sorry if this is easy! I spent many hours crawling the web on this...</p>

<p><code>a'x &gt;= b</code> is the same as <code>-a'x &lt;= -b</code>. I.e. multiply the <code>&gt;=</code> inequality by -1.</p>

python optimization