Retaining the variable value for some consecutive intervals

27 Views Asked by At

I have been trying to model a constraint for a variable in an MIP formulation. My problem is like this; X(t) is a variable, whose value has to remain constant for some pre-defined consecutive periods after its value decreases. So, say at t=2, the X(t=2) value decreases from X(t=1), then X(t) should remain equal to X(t=2) for T consecutive periods following that decrease. Can anyone suggest me how can I do that in an MIP formulation?

1

There are 1 best solutions below

2
On BEST ANSWER

Suppose $X_t$ has constant bounds $[L_t,U_t]$. Introduce binary decision variable $d_t$ to indicate whether $X_t$ decreased from the previous period, and impose the following linear constraints: \begin{align} X_{t-1} - X_t &\le (U_{t-1} - L_t) d_t &&\text{for all $t$} \tag1\label1 \\ (L_t-U_{t+i}) (1-d_t) \le X_t - X_{t+i} &\le (U_t - L_{t+i}) (1-d_t) &&\text{for all $t$ and $i\in\{1,\dots,T\}$} \tag2\label2 \end{align}

Constraint \eqref{1} enforces the logical proposition $X_t < X_{t-1} \implies d_t = 1$. Constraint \eqref{2} enforces the logical proposition $d_t = 1 \implies X_t = X_{t+1} = \dots = X_{t+T}$.