Optimize unit commitment with consecutive unit assignment
AnsweredI am a newbie in MIP and am investigating if Gurobi could be helpful in solving the following optimization problem. Would appreciate any help in this direction.
The context of the problem is framed around committing energy units across a larger time span from different resources (provider offerings). It's different from regular unit commitment problem in the energy sector since the time slots are months and the time span may be several years. There is a restriction regarding the minimum duration (consecutive time slots) that a provider may supply in the time span. There is no relation between the time span of the demand and the time span of the supply. The expected result should be all time slots assigned by the most competitive offerings.
Formulating the problem
We have a model based around a decision variable, x(i,j), indicating assignment of an energy unit from a provider i, for a discrete time unit j (month). The objective is to minimize the total cost for the complete time span based on the cost of each unit commitment, c(i,j) where if a provider is selected it should at least include t_min(i) consecutive time slots as follows:
Objective function: Min { Sum over i and j ( c(i,j) * x(i,j) ) }
i ranges from 1 to 2000 offerings
j ranges from 6 to 120 months
Restrictions:
1) Sum over i, x(i,j) = 1 ---> only one provider offering can occupy a time slot.
2) Sum over j, { x(i,j) = 0, if provider i is not assigned
x(i,j) >= t_min(i), if provider i is assigned
x(i,j) can only be 1 if x(i,j-1) = 1
}
Questions:
1) How should I formulate the problem to use Gurobi MIP algorithm and include the consecutive time slot constrain? (if feasible)
2) If one pass is not feasible and several passes are needed, local optimization per time slot, with subsequent global optimization to include the consecutive time slot constrain, how can this formulation be passed to Gurobi?
-
Official comment
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 otherwiseParameters
\(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
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?. -
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 -
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.
Comments
4 comments