3

I'm in need of an LP where you can multiply two non-constants. Here is the following code that I am trying to perform:

import cvxpy as cvx
a = cvx.Variable()
b = cvx.Variable()
c = cvx.Variable()
obj = cvx.Maximize(((0.4270437386 * a) + (0.1737677971 * b) + (0.21763175116 * c) - 0.03)  /  (((((2 * a * 0.424718270)  * b) * (0.195770376 ** 0.5)) * (0.022090814 ** 0.5)) * ((2 * c * -0.041137487) * b * (0.194241184 ** 0.5) * (0.022090814 ** 0.5)) * (2 * a * 0.363033596 * c * (0.195770376** 0.5) * (0.194241184 ** 0.5))))

Unfortunately this raises an error:

cvxpy.error.DCPError: Cannot multiply two non-constants.

This stems from several areas in the denominator of obj, such as (2 * a * 0.424718270) * b).

I was wondering if anyone knew of any LP programs where we can do this sort of thing? Is it even possible.

Rodrigo de Azevedo
  • 1,097
  • 9
  • 17
Alex McLean
  • 2,524
  • 5
  • 30
  • 53
  • 2
    Please check out http://stackoverflow.com/questions/30774270/how-to-convert-quadratic-to-linear-program for details on how to linearize the product of decision variables in the objective, converting a bilinear optimization problem (which you describe) to a linear optimization problem. – josliber Sep 11 '15 at 20:40

1 Answers1

-1

The issue is that you are asking a linear programming package to optimize for a non-linear objective function. This is much more than a technical issue. The methods used to solve linear programming problems do not make sense and cannot be tweaked.

Degustaf
  • 2,655
  • 2
  • 16
  • 27