The last restriction is essentially a big-M constraint:
min{0,xlo}≤z≤max{0,xup}xlo⋅δ≤z≤xup⋅δx−xup⋅(1−δ)≤z≤x−xlo⋅(1−δ)
where M1, M2 are chosen as tightly as possible while not excluding z=0 when δ=0.
x−M1⋅(1−δ)≤z≤x+M2⋅(1−δ)
For the special case xlo=0 this reduces to:
The construct z=x·δ can be used to model an OR condition: "z=0 OR z=x".
z∈[0,xup]z≤xup·δz≤xz≥x−xup·(1−δ)
that's so cool man! thx!
ReplyDeleteHey i have a problem where i have a function called average_price = a+b*x where x is a variable for the amount of products, a and b is constants from a table. The problem is when we have to find the total price/cost, (a+b*x)*x this makes the non-linear error.. do you have any suggestions ??
ReplyDeleteContinuous * Continuous variable means either use a QP or NLP algorithm or formulate a piecewise linear function.
ReplyDeleteHello,
ReplyDeleteI have used this formulation in two terms of my model that one of them are directly get involved in the objective function. However, I discovered that the corresponding term in the objective function makes the model computationally complicated.
I.e., let R be the linear product of two variables ( acontinuous and a binary one). When I run the model without R in the objective function, the model is being solved in less than 1 minute, but, it will take more than 2 hours with R in the objective function.
Do you know that it is the nature of this formulation, or I did something wrong?
This cannot be answered without much more knowledge about the model, the formulation and the solver.
DeleteThank you
DeleteSo I will mail the model and details to you if you permit?
This has been really helpful for me in model construction. Thanks a lot!!!
ReplyDeleteThank you, that was helpful. It would be better if the last two constraints to be used were clearly highlighted.
ReplyDelete