Solving two stage stochastic problem by DECIS(licensed ver) after few successful iteration getting error "Windows need to close DECIS"

Hello Everyone

I am solving a two stage stochastic programming problem with DECIS as solver (licensed version).

It is successfully generating stochastic file(.stg).
After few 7 iterations it says Windows needs to close DECIS,
Program is given below (Copy & paste to your GAMS) and check the error

Kindly help and please tell me the reason for this error
Program

$ontext
Emerald Article: Supply chain planning using multi stage stochastic programming
Lokesh Nagar, Karuna Jain (2008)
In this article they have compared the results of two stage & multi stage
$offtext

sets

o ‘Set of manufacturing plants’/O1O2/
j ‘Set of customer groups’/J1
J2/
p ‘Set of finished products’/P1/
w ‘Set of distribution centers’/W1
W2/
k ‘Set of parts suppliers’/K1K2/
s ‘Set of parts’/S1/
zi ‘Set of scenarios’/Z1
Z8/
m ‘Set of time periods’/M2*M4/
;

parameter Pzi(zi) Probability of scenario zi
/Z1 0.343, Z2 0.147, Z3 0.147, Z4 0.063, Z5 0.147, Z6 0.063, Z7 0.063, Z8 0.027/;

table Aom(o,m) ‘Time available at plant o in period m (time unit)’

M2 M3 M4
O1 600 650 550
O2 600 550 650
;

table djpmzi(j,m,zi) Demand at customer group J for product p in period m in scenario zi’
*Multi dimensional table
Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8
J1.M2 1000 1000 1000 1000 1500 1500 1500 1500
J1.M3 1200 1200 1500 1500 2000 2000 1800 1800
J1.M4 1500 1800 2000 1800 2500 2200 2100 2400
J2.M2 2000 2000 2000 2000 2500 2500 2500 2500
J2.M3 2200 2200 2500 2500 3000 3000 2800 2800
J2.M4 2500 2800 3000 2800 3500 3200 3100 3400
;
parameter Rop(o) ‘Rate of production for finished product P at plant O (time unit/unit)’
/O1 0.20, O2 0.18 /;

table MCopm(o,m) ‘Manufacturing cost at plant o for product p in period m’

M2 M3 M4
O1 180 180 180
O2 170 170 170
;

table ICopm(o,m) ‘Unit cost of inventory holding at plant o for product p in period m’

M2 M3 M4
O1 25 25 25
O2 30 30 30
;

table OCopm(o,m) ‘Outsourcing cost at plant o for product p in period m’

M2 M3 M4
O1 400 425 425
O2 425 400 425
;

table TCowjp(o,w,j) ‘Transportation cost at for shipping product p from plant o through warehouse w to destination j’
*Multi dimensional table to be entered

J1 J2
O1.W1 30 22
O1.W2 35 25
O2.W1 45 22
O2.W2 35 45
;
table PCkos(k,o,s) ‘Transportation cost for shipping part s from supplier k to plant o’

O1.S1 O2.S1
K1 25 22
K2 22 27
;

table RCks(k,s) ‘Material cost for part s from supplier k’
S1
K1 80
K2 90
;
table PAksm(k,s,m) ‘Part s available with each supplier k in period m’

M2 M3 M4
K1.S1 16500 14000 16500
K2.S1 16500 14000 14000
;

parameter RMsp(s) ‘Utiliztion rate of each part s for one unit of product p’
*RMsp is an assumed data since it is not specified in paper
/S1 2 /
;
*---------------------------------------------------------------------------

  • Core Model
    *---------------------------------------------------------------------------

variables

Mopm(o,m) ‘Amount of product P to be produced at plant O in period M’

Iopmzi(o,m) ‘Amount of end of period inventory at plant O of product P in period M in scenario zi’

OUTopmzi(o,m) ‘Quantity to be outsource at plant O of product P in period M in scenario zi’

xowjpmzi(o,w,j,m) ‘Amount of product P shipped to from plant O through warehouse W to customer group J in period M in scenario zi’

Wkosm(k,o,s,m) ‘Amount of part S shipped from supplier K to plant O in period M’

Z
;

Positive variables Mopm,Iopmzi,OUTopmzi,xowjpmzi,Wkosm;

equations

obj
eq1(o,m)
eq2(m)
eq3(o,m)
eq4(m)
eq7(m)
eq5(k,s,m)
eq6(o,s,m)
;

*Objective function
obj…z =e= sum((k,o,s,m),(Wkosm(k,o,s,m)*RCks(k,s)))+
sum((k,o,s,m),(PCkos(k,o,s)*Wkosm(k,o,s,m)))+
sum((o,m),(MCopm(o,m)Mopm(o,m)))+
sum((o,m,zi),(Pzi(zi)
((ICopm(o,m)Iopmzi(o,m))+(OCopm(o,m)OUTopmzi(o,m)))))+
sum((o,w,j,m,zi),(Pzi(zi)
(TCowjp(o,w,j)
(xowjpmzi(o,w,j,m)))))
;

*Plant capacity constraint
eq1(o,m)…(Rop(o)*Mopm(o,m)) =l= Aom(o,m);

*Inventory balance constraint
eq2(m)…sum(o,(Iopmzi(o,m-1)+Mopm(o,m)+OUTopmzi(o,m)-Iopmzi(o,m))) =e= sum(j,djpmzi(j,m,‘Z1’));


*Balance equation for quantity available to transport
eq3(o,m)…sum((w,j),xowjpmzi(o,w,j,m)) =e= (Iopmzi(o,m-1)+Mopm(o,m)+OUTopmzi(o,m)-Iopmzi(o,m));


*Controls total quantity transferred to individual destination center
eq4(m)…sum((o,w),xowjpmzi(o,w,‘J1’,m)) =e= djpmzi(‘J1’,m,‘Z1’);
eq7(m)…sum((o,w),xowjpmzi(o,w,‘J2’,m)) =e= djpmzi(‘J2’,m,‘Z1’);
*Ensures supplier capacity limits for each part in each period with each supplier
eq5(k,s,m)…sum(o,Wkosm(k,o,s,m)) =l= PAksm(k,s,m);

*Calculates which raw material are required for each of the finished product & how much
*quantity are required for each raw material
eq6(o,s,m)…(RMsp(s)*Mopm(o,m)) =l= sum(k,Wkosm(k,o,s,m));


*model problem /obj,eq1,eq2,eq3,eq4,eq7,eq5,eq6/;
*solve problem minimizing z using lp;
*$ontext
*--------------------------------------------------------------

  • Stage 1/ Stage 2 Classification
    *---------------------------------------------------------------

*Variables
*
Mopm.stage(o,m)=1;
Iopmzi.stage(o,m)=2;
OUTopmzi.stage(o,m)=2;
xowjpmzi.stage(o,w,j,m)=2;
Wkosm.stage(k,o,s,m)=1;

*equations
*
eq1.stage(o,m)=1;
eq2.stage(m)=2;
eq3.stage(o,m)=2;
eq4.stage(m)=2;
eq7.stage(m)=2;
eq5.stage(k,s,m)=1;
eq6.stage(o,s,m)=1;


*---------------------------------------------------------------
*Writing the .STG File
*---------------------------------------------------------------

file stg/MODEL.stg/;
put stg;
scalar temp;
put “INDEP DISCRETE”/;;

loop(m,
loop(zi,
temp = sum(j,djpmzi(j,m,zi))
put "RHS eq2 “,m.tl,” “,temp,” PERIOD2 ",Pzi(zi)/;
);
);

loop(m,
loop(zi,
put "RHS eq4 “,m.tl,” “,djpmzi(‘J1’,m,zi),” PERIOD2 ",Pzi(zi)/;
);
);

loop(m,
loop(zi,
put "RHS eq7 “,m.tl,” “,djpmzi(‘J2’,m,zi),” PERIOD2 ",Pzi(zi)/;
);
);








putclose stg;
*---------------------------------------------------------------
*output a MINOS option file
*---------------------------------------------------------------

file mopt/MINOS.spc/;
put mopt;
put “begin”/;
put “rows 250”/;
put “columns 250”/;
put “elements 10000”/;
put “end”/;
putclose;

*---------------------------------------------------------------
*Solve with default settings
*---------------------------------------------------------------
option lp=decism;
model problem /obj,eq1,eq2,eq3,eq4,eq7,eq5,eq6/;
solve problem minimizing z using lp;
*---------------------------------------------------------------
*Solving exactly using DECIS option ISTRAT 4
*---------------------------------------------------------------
file decopt /decism.opt/;
put decopt;
put ‘4"ISTRAT"’/;
putclose;

problem.optfile=1;
solve problem minimizing z using lp;
*$offtext



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/k7i5P6PyCS4J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Could I see the model?

On Monday, December 17, 2012 3:53:47 PM UTC+9, Ankur1109 wrote:

Hello Everyone

I am solving a two stage stochastic programming problem with DECIS as solver (licensed version).

It is successfully generating stochastic file(.stg).
After few 7 iterations it says Windows needs to close DECIS,
Program is given below (Copy & paste to your GAMS) and check the error

Kindly help and please tell me the reason for this error
Program

$ontext
Emerald Article: Supply chain planning using multi stage stochastic programming
Lokesh Nagar, Karuna Jain (2008)
In this article they have compared the results of two stage & multi stage
$offtext

sets

o ‘Set of manufacturing plants’/O1O2/
j ‘Set of customer groups’/J1
J2/
p ‘Set of finished products’/P1/
w ‘Set of distribution centers’/W1
W2/
k ‘Set of parts suppliers’/K1K2/
s ‘Set of parts’/S1/
zi ‘Set of scenarios’/Z1
Z8/
m ‘Set of time periods’/M2*M4/
;

parameter Pzi(zi) Probability of scenario zi
/Z1 0.343, Z2 0.147, Z3 0.147, Z4 0.063, Z5 0.147, Z6 0.063, Z7 0.063, Z8 0.027/;

table Aom(o,m) ‘Time available at plant o in period m (time unit)’

M2 M3 M4
O1 600 650 550
O2 600 550 650
;

table djpmzi(j,m,zi) Demand at customer group J for product p in period m in scenario zi’
*Multi dimensional table
Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8
J1.M2 1000 1000 1000 1000 1500 1500 1500 1500
J1.M3 1200 1200 1500 1500 2000 2000 1800 1800
J1.M4 1500 1800 2000 1800 2500 2200 2100 2400
J2.M2 2000 2000 2000 2000 2500 2500 2500 2500
J2.M3 2200 2200 2500 2500 3000 3000 2800 2800
J2.M4 2500 2800 3000 2800 3500 3200 3100 3400
;
parameter Rop(o) ‘Rate of production for finished product P at plant O (time unit/unit)’
/O1 0.20, O2 0.18 /;

table MCopm(o,m) ‘Manufacturing cost at plant o for product p in period m’

M2 M3 M4
O1 180 180 180
O2 170 170 170
;

table ICopm(o,m) ‘Unit cost of inventory holding at plant o for product p in period m’

M2 M3 M4
O1 25 25 25
O2 30 30 30
;

table OCopm(o,m) ‘Outsourcing cost at plant o for product p in period m’

M2 M3 M4
O1 400 425 425
O2 425 400 425
;

table TCowjp(o,w,j) ‘Transportation cost at for shipping product p from plant o through warehouse w to destination j’
*Multi dimensional table to be entered

J1 J2
O1.W1 30 22
O1.W2 35 25
O2.W1 45 22
O2.W2 35 45
;
table PCkos(k,o,s) ‘Transportation cost for shipping part s from supplier k to plant o’

O1.S1 O2.S1
K1 25 22
K2 22 27
;

table RCks(k,s) ‘Material cost for part s from supplier k’
S1
K1 80
K2 90
;
table PAksm(k,s,m) ‘Part s available with each supplier k in period m’

M2 M3 M4
K1.S1 16500 14000 16500
K2.S1 16500 14000 14000
;

parameter RMsp(s) ‘Utiliztion rate of each part s for one unit of product p’
*RMsp is an assumed data since it is not specified in paper
/S1 2 /
;
*---------------------------------------------------------------------------

  • Core Model
    *---------------------------------------------------------------------------

variables

Mopm(o,m) ‘Amount of product P to be produced at plant O in period M’

Iopmzi(o,m) ‘Amount of end of period inventory at plant O of product P in period M in scenario zi’

OUTopmzi(o,m) ‘Quantity to be outsource at plant O of product P in period M in scenario zi’

xowjpmzi(o,w,j,m) ‘Amount of product P shipped to from plant O through warehouse W to customer group J in period M in scenario zi’

Wkosm(k,o,s,m) ‘Amount of part S shipped from supplier K to plant O in period M’

Z
;

Positive variables Mopm,Iopmzi,OUTopmzi,xowjpmzi,Wkosm;

equations

obj
eq1(o,m)
eq2(m)
eq3(o,m)
eq4(m)
eq7(m)
eq5(k,s,m)
eq6(o,s,m)
;

*Objective function
obj…z =e= sum((k,o,s,m),(Wkosm(k,o,s,m)*RCks(k,s)))+
sum((k,o,s,m),(PCkos(k,o,s)*Wkosm(k,o,s,m)))+
sum((o,m),(MCopm(o,m)Mopm(o,m)))+
sum((o,m,zi),(Pzi(zi)
((ICopm(o,m)Iopmzi(o,m))+(OCopm(o,m)OUTopmzi(o,m)))))+
sum((o,w,j,m,zi),(Pzi(zi)
(TCowjp(o,w,j)
(xowjpmzi(o,w,j,m)))))
;

*Plant capacity constraint
eq1(o,m)…(Rop(o)*Mopm(o,m)) =l= Aom(o,m);

*Inventory balance constraint
eq2(m)…sum(o,(Iopmzi(o,m-1)+Mopm(o,m)+OUTopmzi(o,m)-Iopmzi(o,m))) =e= sum(j,djpmzi(j,m,‘Z1’));


*Balance equation for quantity available to transport
eq3(o,m)…sum((w,j),xowjpmzi(o,w,j,m)) =e= (Iopmzi(o,m-1)+Mopm(o,m)+OUTopmzi(o,m)-Iopmzi(o,m));


*Controls total quantity transferred to individual destination center
eq4(m)…sum((o,w),xowjpmzi(o,w,‘J1’,m)) =e= djpmzi(‘J1’,m,‘Z1’);
eq7(m)…sum((o,w),xowjpmzi(o,w,‘J2’,m)) =e= djpmzi(‘J2’,m,‘Z1’);
*Ensures supplier capacity limits for each part in each period with each supplier
eq5(k,s,m)…sum(o,Wkosm(k,o,s,m)) =l= PAksm(k,s,m);

*Calculates which raw material are required for each of the finished product & how much
*quantity are required for each raw material
eq6(o,s,m)…(RMsp(s)*Mopm(o,m)) =l= sum(k,Wkosm(k,o,s,m));


*model problem /obj,eq1,eq2,eq3,eq4,eq7,eq5,eq6/;
*solve problem minimizing z using lp;
*$ontext
*--------------------------------------------------------------

  • Stage 1/ Stage 2 Classification
    *---------------------------------------------------------------

*Variables
*
Mopm.stage(o,m)=1;
Iopmzi.stage(o,m)=2;
OUTopmzi.stage(o,m)=2;
xowjpmzi.stage(o,w,j,m)=2;
Wkosm.stage(k,o,s,m)=1;

*equations
*
eq1.stage(o,m)=1;
eq2.stage(m)=2;
eq3.stage(o,m)=2;
eq4.stage(m)=2;
eq7.stage(m)=2;
eq5.stage(k,s,m)=1;
eq6.stage(o,s,m)=1;


*---------------------------------------------------------------
*Writing the .STG File
*---------------------------------------------------------------

file stg/MODEL.stg/;
put stg;
scalar temp;
put “INDEP DISCRETE”/;;

loop(m,
loop(zi,
temp = sum(j,djpmzi(j,m,zi))
put "RHS eq2 “,m.tl,” “,temp,” PERIOD2 ",Pzi(zi)/;
);
);

loop(m,
loop(zi,
put "RHS eq4 “,m.tl,” “,djpmzi(‘J1’,m,zi),” PERIOD2 ",Pzi(zi)/;
);
);

loop(m,
loop(zi,
put "RHS eq7 “,m.tl,” “,djpmzi(‘J2’,m,zi),” PERIOD2 ",Pzi(zi)/;
);
);








putclose stg;
*---------------------------------------------------------------
*output a MINOS option file
*---------------------------------------------------------------

file mopt/MINOS.spc/;
put mopt;
put “begin”/;
put “rows 250”/;
put “columns 250”/;
put “elements 10000”/;
put “end”/;
putclose;

*---------------------------------------------------------------
*Solve with default settings
*---------------------------------------------------------------
option lp=decism;
model problem /obj,eq1,eq2,eq3,eq4,eq7,eq5,eq6/;
solve problem minimizing z using lp;
*---------------------------------------------------------------
*Solving exactly using DECIS option ISTRAT 4
*---------------------------------------------------------------
file decopt /decism.opt/;
put decopt;
put ‘4"ISTRAT"’/;
putclose;

problem.optfile=1;
solve problem minimizing z using lp;
*$offtext



\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\