Solve Quadratic Programming in Sage

189 views
Skip to first unread message

pegah Ali

unread,
Jan 5, 2015, 10:35:23 AM1/5/15
to sage-s...@googlegroups.com
Hello guys,

I have a quadratic programming for instance like the following equation:

  max  t1.f1 + t2.f2 + 0.5f1 + 0.3f2
  subj to :  0.1t1 + 0.2t2 <= 1
                  2f1 + 4f2    <= 0.5

(f1, f2, t1 and t2 are unknown variables).
If I had min instead of max in the program, I would be able to solve it by using  solvers.qp()  in CVXOPT and change the program to the following form :
  

But in case of maximization, I don't know which solvers can I use and even how can I modify the program in order to be solved by another solver. 
I would be appreciated for your helps and comments.

Regards
Pegah           

Dominique Laurain

unread,
Jan 5, 2015, 4:43:33 PM1/5/15
to sage-s...@googlegroups.com
Hello guy,

Your "question" looks like a modeling math problem, ...and is not related to SAGE.

I wouln't try to solve "quadratic" problem using "linear" solvers : LP means "Linear Programming"

for definition of LP, read
http://www.sagemath.org/doc/reference/numerical/sage/numerical/mip.html

more over : "CVXOPT" is short word for ConVeX OPTimization.

At first sight, it looks like you want to maximize a no-concave function..and such a problem has sometimes no finite solution...

if (for example)
t2 = -0.5 t1  => 0.1t1 + 0.2t2 = 0 <= 1
f2 = -0.5 f1 => 2f1 + 4f2 = 0 <= 0.5

then

t1.f1 + t2.f2 + 0.5f1 + 0.3f2 = t1.f1  + 2.5t1.f1 + 0.5f1 -0.15f1 = 3.5t1f1 + 0.35f1

so when (for example) f1 = 1.0 you can find f1  very large positive to get  t1.f1 + t2.f2 + 0.5f1 + 0.3f2 > N whatever N value you choose.

Dominique.
Reply all
Reply to author
Forward
0 new messages