Multiplication Decision Variables
AnsweredHey all,
I have the following decision boolean variables x[t] and w[t], and an auxiliary variable p[t].
p[t] = p[t - 1] + w[t] * constant
p[t] <= Max Value
But I have also a condition where if x[t] == 1 then p[t] will reset to 0.
I had the following condition p[t] =(1 - x[t]) * (p[t - 1] + w[t] * constant) but I was getting a non linear formulation.
Is there a work around this problem?
Thanks!
-
Hi Carlos,
What if you would introduce a variable to represent the magnitude of the reset \(r_t\) ; then you constraint becomes \(p_t=p_{t-1} + w_t * C - r_t\).
You could then add indicator constraints enforcing
- \(r_t=0\) when \(x_t=0\)
- \(p_t=0\) when \(x_t=1\)
Kind regards,
Ronald0 -
In fact, you can simplify further and not introduce \(r_t\) at all. Just use two indicator constraints to ensure
- \(p_t=p_{t-1}+w_t \cdot C\) when \(x_t=0\)
- \(p_t=0\) when \(x_t=1\)
1 -
Thanks Ronald! Worked for me :)
0
Please sign in to leave a comment.
Comments
3 comments