Linear Programming and Piecewise

January 07 2011 by alex_01 2978
false
Maple

0


I can solve a [0,1] linear programming problem by using:

LPSolve(Ob, con, assume = binary);


I managed to solve [-1,1] linear programming problem by using the transformation
2*w[i]-1 ie   2*0-1=-1 and 2*1-1=1 as follows:

LPSolve(add(PP[i]*(2*w[i]-1), i = 1 .. NC)-add(Draw[i]*(2*w[i]-1), i = 1 .. NC), {add(w[i], i = 1 .. NC) = PS}, maximize = true, assume = binary);


Now my question is how can I solve a [-1,0,1] problem?
I tried to use:

piecewise(w[i] >= 1, 1, w[i] <= -1, -1, 0);   and   assume = integer

but Maple is complaning that the objective function is not linear hummm



 
Loading Comments & Answers

You must be logged into your MaplePrimes account in order to post a comment. If you don't have an account, you can create an account here.

     

Forgot Your Password? Create an Account