problem with multiple set....

Hello Everybody,

I am facing a problem with multiple set. i.e between m and p in the following command

My problem in short:
I have two machines, but want to produce three different products.
Each machine can produce only one product at a time. production time is 5 days.

2 machines - 3 products is the problem.
if it is 3 machine- 3 products… i would have produce each product in each machine separately.

pls chek the blue line. any suggestion for improvement. Thanks in Advance…


Set t time /120/
Set p product /1
3/
Set m machine /1*2/

Parameter Demand(t,p),Ordermin,Production,ptime;
Ordermin=50;
Demand(t,p) = normal(20,1);
Production=50;
ptime=5;

Variables Order(t,p), Startt(t,m), Endd(t,m), cumorder;
Binary variables b(t,p), Macstatus(t,m);

Equations Eq1(t,p,m), con1(t,p), Eq2(t,m), Eq3(t,p,m), Eq4(t,m), obj;

Eq1(t,p,m)… Order(t,p) =e= Order(t-1,p) + Demand(t,p) -ProductionEndd(t,m);
con1(t,p)… Order(t,p) =l= Ordermin + 100000
b(t,p);
Eq2(t,m)… Macstatus(t,m) =e= Macstatus(t-1,m) + Startt(t-1,m) - Endd(t,m); Macstatus(t,m) = 0 (idle), 1( in-production)
Eq3(t,p,m)… Startt(t,m) =e= b(t,p)*(1-Machinestatus(t,m)); Startt(t,m)= 1(begining), 0 otherwise
Eq4(t,m)… Endd(t,m) =e= Startt(t-ptime,m); Endd(t,m) = 1(production finished), 0 otherwise
obj… cumorder =e= sum((t,p),Order(t,p));

Model productionn /all/;

OPTION OPTCR = 0.0, OPTCA = 0.0;
SOLVE productionn MINIMIZING cumorder USING MINLP ;
Display Demand,Order.L,Machinestatus.L,Startt.L,Endd.L,cumorder.L

Thanks
Swin

–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—

Swin,

After chaning some the variables from Machinestatus to Macstatus the
model solved ok with SBB (I uploaded the LST file to the file area). I
did not carefully go through the model but it seems that you should be
able to write this as a MIP. Only Eq3 is nonlinear (and makes the
model highly nonconvex). One can reformulate Eq3 linearly (with the
usual tricks, again the reading of the book by HP Williams,
http://www.amazon.com/Model-Building-Mathematical-Programming-4th/dp/0471997889
will help).

Hope this helps.
Michael Bussieck - GAMSWorld Coordinator

On Oct 6, 7:55 pm, “Sundar Raj” wrote:

Hello Everybody,

I am facing a problem with multiple set. i.e between m and p in the
following command

My problem in short:
I have two machines, but want to produce three different products.
Each machine can produce only one product at a time. production time is 5
days.

2 machines - 3 products is the problem.
if it is 3 machine- 3 products… i would have produce each product in
each machine separately.

pls chek the blue line. any suggestion for improvement. Thanks in
Advance…

---------------------------------------------------------------------------­------------------------------------------
Set t time /120/
Set p product /1
3/
Set m machine /1*2/

Parameter Demand(t,p),Ordermin,Production,ptime;
Ordermin=50;
Demand(t,p) = normal(20,1);
Production=50;
ptime=5;

Variables Order(t,p), Startt(t,m), Endd(t,m), cumorder;
Binary variables b(t,p), Macstatus(t,m);

Equations Eq1(t,p,m), con1(t,p), Eq2(t,m), Eq3(t,p,m), Eq4(t,m), obj;

Eq1(t,p,m)… Order(t,p) =e= Order(t-1,p) + Demand(t,p)
-ProductionEndd(t,m);
con1(t,p)… Order(t,p) =l= Ordermin +
100000
b(t,p);

Eq2(t,m)… Macstatus(t,m) =e= Macstatus(t-1,m) + Startt(t-1,m) -
Endd(t,m); Macstatus(t,m) = 0 (idle), 1( in-production)
Eq3(t,p,m)… Startt(t,m) =e=
b(t,p)*(1-Machinestatus(t,m)); Startt(t,m)=
1(begining), 0 otherwise
Eq4(t,m)… Endd(t,m) =e=
Startt(t-ptime,m);
Endd(t,m)
= 1(production finished), 0 otherwise
obj… cumorder =e= sum((t,p),Order(t,p));

Model productionn /all/;

OPTION OPTCR = 0.0, OPTCA = 0.0;
SOLVE productionn MINIMIZING cumorder USING MINLP ;
Display Demand,Order.L,Machinestatus.L,Startt.L,Endd.L,cumorder.L

Thanks
Swin
–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—

\

Still problem hasnt rectified. There are only two machines. it can
produce only two of three products at any time. but Eq1(t,p,m)
increases all products to 50.

May be some conflict in Eq1. i will be happy if you could suggest to
rectify it…

Swin

On Oct 6, 8:23 pm, Gamsworld Admin wrote:

Swin,

After chaning some the variables from Machinestatus to Macstatus the
model solved ok with SBB (I uploaded the LST file to the file area). I
did not carefully go through the model but it seems that you should be
able to write this as a MIP. Only Eq3 is nonlinear (and makes the
model highly nonconvex). One can reformulate Eq3 linearly (with the
usual tricks, again the reading of the book by HP Williams,http://www.amazon.com/Model-Building-Mathematical-Programming-4th/dp/
will help).

Hope this helps.
Michael Bussieck - GAMSWorld Coordinator

On Oct 6, 7:55 pm, “Sundar Raj” wrote:

Hello Everybody,

I am facing a problem with multiple set. i.e between m and p in the
following command

My problem in short:
I have two machines, but want to produce three different products.
Each machine can produce only one product at a time. production time is 5
days.

2 machines - 3 products is the problem.
if it is 3 machine- 3 products… i would have produce each product in
each machine separately.

pls chek the blue line. any suggestion for improvement. Thanks in
Advance…

---------------------------------------------------------------------------­­------------------------------------------
Set t time /120/
Set p product /1
3/
Set m machine /1*2/

Parameter Demand(t,p),Ordermin,Production,ptime;
Ordermin=50;
Demand(t,p) = normal(20,1);
Production=50;
ptime=5;

Variables Order(t,p), Startt(t,m), Endd(t,m), cumorder;
Binary variables b(t,p), Macstatus(t,m);

Equations Eq1(t,p,m), con1(t,p), Eq2(t,m), Eq3(t,p,m), Eq4(t,m), obj;

Eq1(t,p,m)… Order(t,p) =e= Order(t-1,p) + Demand(t,p)
-ProductionEndd(t,m);
con1(t,p)… Order(t,p) =l= Ordermin +
100000
b(t,p);

Eq2(t,m)… Macstatus(t,m) =e= Macstatus(t-1,m) + Startt(t-1,m) -
Endd(t,m); Macstatus(t,m) = 0 (idle), 1( in-production)
Eq3(t,p,m)… Startt(t,m) =e=
b(t,p)*(1-Machinestatus(t,m)); Startt(t,m)=
1(begining), 0 otherwise
Eq4(t,m)… Endd(t,m) =e=
Startt(t-ptime,m);
Endd(t,m)
= 1(production finished), 0 otherwise
obj… cumorder =e= sum((t,p),Order(t,p));

Model productionn /all/;

OPTION OPTCR = 0.0, OPTCA = 0.0;
SOLVE productionn MINIMIZING cumorder USING MINLP ;
Display Demand,Order.L,Machinestatus.L,Startt.L,Endd.L,cumorder.L

Thanks
Swin- Hide quoted text -