Loading [MathJax]/jax/output/CommonHTML/jax.js

Saturday, December 31, 2016

MIP Modeling

In an investment planning model I needed to model the following:

image

We can build a facility during any time period. So we have:

buildt{0,1}tbuildt1

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=buildt1 or opent1

This can be linearized as:

opentbuildt1opentopent1opentbuildt1+opent1

alternative 3

We can simplify the recursive construct:

opent=buildt1+opent1

With this, we now explicitly forbid buildt1+opent1=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=buildt11+opent11=0+0. We can also verify this in the equation listing:

---- eqopen2  =E= 

eqopen2(t1)..  open(t1) =E= 0 ; (LHS = 0)
    
eqopen2(t2)..  - build(t1) - open(t1) + open(t2) =E= 0 ; (LHS = 0)
    
eqopen2(t3)..  - build(t2) - open(t2) + open(t3) =E= 0 ; (LHS = 0)
    
REMAINING 3 ENTRIES SKIPPED

No comments:

Post a Comment