LPSolve Matrix Form

December 28 2011 by alex_01 2978
false
Maple 13

0


Ok, I want to solve the below code as fast and efficient as possible.
Since it is an LP problem LPSolve(Matrix Form) should be the best.

The problem is that the default objective function in LPSolve(Matrix Form)
is c'x which creates a bit of a problem since my objective function is not a
function of x. My objective function is simply ur + dr. How can I solve that?!

restart:
randomize():
with(Optimization):
with(Statistics):
with(LinearAlgebra):

N := 50:
W := Vector(N, symbol = w):
R := RandomMatrix(N, outputoptions = [datatype = float[8]]):
ER := Vector[column]([seq(ExpectedValue(Column(R, j)), j = 1 .. N)]):
S := Vector(N, fill = 1, datatype = float[8]):
z := Multiply(R, Matrix(W)):

con1 := Transpose(W).S = 1:
con2 := seq(w[i] >= 0, i = 1 .. N):
con3 := seq(w[i] <= 1, i = 1 .. N):
con4 := seq(z[i][1] >= dr, i = 1 .. N):
con5 := expand(Transpose(W).ER) >= ur:

LPSolve(ur+dr, {con1, con2, con3, con4, con5}, maximize = true):

 
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