In an investment planning model I needed to model the following:
We can build a facility during any time period. So we have:
buildt∈{0,1}∑tbuildt≤1 |
The variable opent∈{0,1} indicates we have an open facility, ready to do business. A facility is considered open after it is built (we don’t close facilities during the planning horizon). To be more precise: it becomes available one period after it has been built.
There are actually a few ways to model this:
alternative 1
Look if the facility was built in any period t′<t:
opent=∑t′|t′<tbuildt′ |
alternative 2
Use an ‘or’ formulation:
opent=buildt−1 or opent−1 |
This can be linearized as:
opent≥buildt−1opent≥opent−1opent≤buildt−1+opent−1 |
alternative 3
We can simplify the recursive construct:
opent=buildt−1+opent−1 |
With this, we now explicitly forbid buildt−1+opent−1=2 which was not allowed (implicitly) anyway.
The last formulation seems preferable in terms of simplicity and the number of non-zero elements needed.
As usual with lags we need to be careful what happens near the borders, in this case when t=t1. We just can fix opent1=0. When using GAMS you can even skip that, as indexing with lags outside the domain returns zero. Here that means opent1=buildt1−1+opent1−1=0+0. We can also verify this in the equation listing:
---- eqopen2 =E= eqopen2(t1).. open(t1) =E= 0 ; (LHS = 0) |
No comments:
Post a Comment