How to ensure an increase happens a certain interval after the last decrease in a variable?

25 Views Asked by At

I have three binary variables x, y, and z each indicating an increase, decrease, and stable values of another variable P. Now the issue is I want to formulate a constraint that makes sure that a y can only take place after a x happens, the value of z should be 1 for at least T amount of intervals. To clarify more the following points must be noted:

  1. y can be 1 in consecutive intervals but x cannot take 1 immediately after y takes 1, z can take the value 1 but once z takes 1 , it must maintain the value for T intervals.
  2. x can take 1 in consecutive intervals and there's no limit on it taking that value except only to be restricted by the upper limit of p which is Pmax.
  3. z can take one after y takes one and there is no such T amount of time waiting for y to take 1 again.
  4. The summation of x+y+z=1 at all time intervals. enter image description here
  5. One thing that complicates this situation more is that the optimization is executed for an hourly interval for days, so any (t-1) expression should be formulated while considering first hour operation. If t=1, then x(t-1) will not make any sense. Similarly t+1 expression will not make any sense at the last hour.
  6. The formulation must not be non-linear. Only LP or MIP formulations are allowed.
1

There are 1 best solutions below

0
On

You can derive linear constraints somewhat automatically by writing a logical proposition in conjunctive normal form. For example, here's the first one:

"x cannot take 1 immediately after y takes 1" $$ \lnot (x_t \land y_{t-1}) \\ \lnot x_t \lor \lnot y_{t-1} \\ (1-x_t) + (1-y_{t-1}) \ge 1 \\ x_t + y_{t-1} \le 1 $$