Infeasible model

Problems with modeling
Post Reply
mlftx
User
User
Posts: 5
Joined: 1 year ago

Infeasible model

Post by mlftx »

Hi would anyone tell me why this model is Infeasible

Code: Select all

$title GLSP
option reslim = 3600;
option iterlim = 100000;
option LimRow = 100;
Sets
k indice dei prodotti /k0,k1,k2/
t indice dei macroperiodi t /t1,t2/
s indice dei microperiodi produttivi s /s1,s2,s3,s4/
swith(t,s) /t1.s1*s2, t2.s3*s4/
;
alias(kp,k)
;
Parameters
I0(k) inventario iniziale /k0 0, k1 0, k2 0/
sc(kp,k) costo di setup da kp a k /k0.k1 0, k0.k2 0, k1.k0 0, k1.k2 1, k2.k0 0, k2.k1 2/
ac(k) costo di stand by per preservare la macchina per il prodotto k /k0 0, k1 1, k2 2/
hc(k) costo di stoccaggio per il prodotto k /k0 0, k1 1, k2 2/
tb(k) tempo di produzione di un'unità di k /k0 0, k1 1, k2 2/
ts(kp,k) tempo di setup da i a k /k0.k1 0, k0.k2 0, k1.k0 0, k1.k2 1, k2.k0 0, k2.k1 2/
d(k,t) domanda del prodotto k nel macroperiodo t 
Cmax(t) capacità del macroperiodo t /t1 500, t2 500/
qmin(k) per k>0 è il lotto minimo per k=0 è il tempo minimo di idle state /k0 1, k1 1, k2 2/
M numero molto grande /1000/
;
Table d(k,t)
   t1 t2
k0 0  0
k1 10 5
k2 5  10
;
Variables
Q(k,s) quantità di prodotto k realizzata in s
Qs(k,s) tempo di s in cui la macchina è settata per k ma non produce quando k=0 è il tempo idle in s
I(k,t) quantità di prodotto k stoccata al termine di t
ZF funzione obiettivo
;
Binary variables
g(kp,k,s) indica un cambio
w(k,s) indica un sempo di setup
;
Equations
Funzioneobiettivo 
Uno(t,k) 
Due(t) 
Tre(s)
Quattro(k,s)
Cinque(k,s)
Sei(s)
Sette (kp,k,s)
;
*ZF
Funzioneobiettivo..
ZF =e= sum((k,t), hc(k) * I(k,t)) + sum((kp,k,s) $ (ord(k) <> ord(kp)), sc(kp,k) * g(kp,k,s)) + sum((k,s), ac(k) * Qs(k,s));
*1
Uno(t,k)..
I0(K)$(ord(t)=1)+I(k,t-1)$(ord(t)>1) + sum(s$swith(t,s), Q(k,s)) - I(k,t) =e= d(k,t);
*2
Due(t)..
sum((k,s), tb(k) * Q(k,s) + Qs(k,s)) + sum((kp,k,s)$(ord(k) <> ord(kp)), ts(kp,k)*g(kp,k,s)) =e= Cmax(t);
*3
Tre(s) $ (ord(s)>1)..
Qs('k0',s) =g= qmin('k0')*(w('k0',s)-w('k0',s-1));
*4
Quattro(k,s) $ (ord(k)>1)..
Q(k,s)+Qs(k,s) =l= M*w(k,s);
*5
Cinque(k,s) $ (ord(s)>1 $(ord(k)>1))..
Q(k,s) =g= qmin(k) * (w(k,s)-w(k,s-1));
*6
Sei(s)..
sum(k, w(k,s)) =e= 1;
*7
Sette(kp,k,s) $ (ord(k) <> ord(kp) $ (ord(s)>1))..
g(kp,k,s) =g= w(kp,s-1)+w(k,s)-1;
model GLSP_test /All /;
solve GLSP_test minimizing ZF using MIP;
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Infeasible model

Post by bussieck »

It's not. The (GAMS/Cplex) log says: "--- MIP status (118): integer unbounded". So add a lower bound to the objective (e.g. ZF.lo=-1e6) and see what variables "run away".

-Michael
Post Reply