I have a constraint in which two continuous variables are being multiplied (price and time) and as a method for linearizing my problem I want to convert price to a discete variable and then doing some linearizing techniques. However, the values of price variable has up to 4 or 5 decimals. I was wondering how I should do this and also how I should code this problem in the cplex.
this constraint looks like this:
price * time >= Ub
I would appreciate it if anyone could help me with this problem.
p.s. I was trying to write a constraint in opl to let me get the floor of this continuous variable but I wasn't successful.
I was trying to use this technique:
price = sum (2^n-1) * p
First in OPL CPLEX you can use some quadratic constraints:
See example qcpex1.mod
You can also linearize the product as can be seen at https://github.com/AlexFleischerParis/howtowithopl/blob/master/multiply2float.mod
if you manage to turn one of the float decision variables into a discrete decision variable you may simply use https://github.com/AlexFleischerParis/howtowithopl/blob/master/multiplyintegerdecisionvariablebydecisionvariable.mod