Skip to main content

Optimize unit commitment with consecutive unit assignment

Answered

Comments

4 comments

  • Official comment
    Rodrigo Fuentes
    • Gurobi Staff Gurobi Staff

    Hi Patricio,

    Although the problem you are working with is different than the "traditional" unit commitment in the sense that your time slots are  months and the span could be years, the mathematics are not  particularly different than the traditonal unit commitment. This means  that you might benefit from known available traditional unit commitment  formulations that can apply to your problem.

    For the "consecutive time slot" constraint, it will be necessary to define additional variables to model when the energy supply starts and ends (\(y\) and z, respectively).


    In your particular case, you have:

    Sets:
    \(I\): Offerings (1..2000)
    \(J\): Months (1..115)

    Variables:

    \(x_{i,j}\) = 1 if provider \(i\) supplies energy in time slot \(j\), 0 otherwise
    \(y_{i,j}\) = 1 if provider \(i\) starts supplying energy in time slot \(j\), 0 otherwise
    \(z_{i,j}\) = 1 if provider \(i\) stops supplying energy in time slot \(j\), 0 otherwise

    Parameters
    \(c_{i,j}\): provider \(i\) cost during time slot \(J\)
    \(t\_min_{i}\): minimum number of consecutive time lots provider \(i\) needs to supply energy once (minimum online time)

     

    The problem can be stated as:

    Minimize

    $$\begin{align*} \sum_{i \in I} \sum_{j \in J} \bigg( c_{i,j} x_{i,j} \bigg)
    \end{align*}$$

    Subject to:

    Only one provider can be assigned in a given time slot:

    $$\begin{align*} \sum_{i \in I} x_{i,j} = 1 \;\; \forall j \in J
    \end{align*}$$

    Consecutive time slots:

    $$\begin{align*} x_{i,j} \geq \sum_{j^{'}=j+1-t\_min_{i}}^{j} y_{i,j^{'}} \;\; \forall i \in I \;\;\forall j \in J
    \end{align*}$$

    Logical Constraints: 

    $$\begin{align*}x_{i,j-1} -x_{i,j} + y_{i,j} - z_{i,j}= 0 \;\;\;\forall i \in I \;\;\forall j \in J \end{align*}$$

    To your question, the unit commitment problem can be solved in a "single" pass. This means that it most cases it can be solved to global optimality. Please have a look at our Electrical Power Generation examples. This will give you additional modeling ideas and also show you our Python API. 

    https://www.gurobi.com/resource/electrical-power-generation-jupyter-notebook-i-and-ii/

    Have fun!

  • Official comment
    Simranjit Kaur
    • Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Patricio Sobrado
    • Gurobi-versary
    • First Question
    • First Comment

    Hi Rodrigo, first of all thank you so much for the initial guidance and the provided links, particularly the reference to Wiliams-Model-Building-in-Mathematical-Programming-5th-2013. Being new to this matter it is a splendid start, so I appreciate your help.

    Some comments:

    1. Regarding the provided links, these do not provide an actual implementation of the consecutive time slot constrain, so I would appreciate if you could share a practical example of how that is done.

    2. Further the last constrain, the logical constrain seems incomplete. Should there be anything in the question mark?

               xi,j−1 − xi,j + yi,j − zi,j = ?      ∀i∈I∀j∈J

    3. How should I interpret this logical constrain, what does it enforce?

    0
  • Rodrigo Fuentes
    • Gurobi Staff Gurobi Staff

    Hi Patricio,

    To your comments, questions:

    1. We don't have an implementation of the consecutive time slot constraint you describe. However, with the implementations for electrical power generation (I and II), other examples, and the formulation provided, you should be able to write your own Python implementation.

    2. Yes, thank you for the observation. This was corrected.

    3. That logical constraint sets a startup variable \(y\) to 1 only when the status \(x\) of the supplier changes from offline to online, and it sets a shutdown variable \(z\) to 1 only when the  status of the supplier \(x\) changes from online to offline.

    Rodrigo

    1

Post is closed for comments.