Slack variables

Dear Members of GAMS world,

I added some slack variables to my code, then I found the problem has no solution. I can get the optimal solution before adding the slacks.
But I cannot tell the difference, and don’t know why this could happen. My code is as below:

eq20(t)… sum(i,E(i,t))+ebd(t)+loe(t)=e=D(t);
eq21… -lp+sum(t,loe(t))/sum(t,D(t))=e=0;
eq22(i,t)(ord(i) lt 3).. -RE(i,t)*P(i)*eta(i)*n(i)+e(i,t)=e=0; eq23(i,t)(ord(i) eq 3)… -RE(i,t)*P(i)*eta(i)*m(t)+e(i,t)=e=0;

then I change to

eq20(t)… -sum(i,e(i,t))-ebd(t)-loe(t)-slackc(t)=l=D(t);
eq21… -lp+sum(t,loe(t))/sum(t,D(t))-slackd=l=0;
eq22(i,t)(ord(i) lt 3).. -RE(i,t)*P(i)*eta(i)*n(i)+e(i,t)-slacka(i,t)=l=0; eq23(i,t)(ord(i) eq 3)… -RE(i,t)*eta(i)*m(t)+e(i,t)-slackb(i,t)=l=0;
eq24(i,t)… slacka(i,t)=l=1e-6;
eq25(i,t)… slackb(i,t)=l=1e-6;
eq26(t)… slackc(t)=l=1e-6;
eq27… slackd=l=1e-6;

Can any body tell me why for the second case I can’t get a solution? I added the slacks because I want to convert the equalities into inequalities. If not by adding slacks, is there any other way deal with it correctly?
Thank you.

Regards,
Tina


\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Tine



You have the math wrong. You can change an inequality to an equality by adding a slack but not the other way round.



Consider the simple equality x =E= 0;



This has only one solution, namely x equal to zero. Adding a slack the way you do gives

x – s =L= 0; s =L= 0;



This set of constraints have lots of solutions, for example x = -1 and s = 0 or x = -1 and s = -1.



Regards



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, Fax: (+45) 44 49 03 33, email: adrud@arki.dk



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Tina
Sent: Friday, February 01, 2013 5:03 AM
To: gamsworld@googlegroups.com
Subject: Slack variables



Dear Members of GAMS world,



I added some slack variables to my code, then I found the problem has no solution. I can get the optimal solution before adding the slacks.

But I cannot tell the difference, and don’t know why this could happen. My code is as below:



eq20(t)… sum(i,E(i,t))+ebd(t)+loe(t)=e=D(t);
eq21… -lp+sum(t,loe(t))/sum(t,D(t))=e=0;
eq22(i,t)(ord(i) lt 3).. -RE(i,t)*P(i)*eta(i)*n(i)+e(i,t)=e=0; eq23(i,t)(ord(i) eq 3)… -RE(i,t)*P(i)*eta(i)*m(t)+e(i,t)=e=0;



then I change to



eq20(t)… -sum(i,e(i,t))-ebd(t)-loe(t)-slackc(t)=l=D(t);
eq21… -lp+sum(t,loe(t))/sum(t,D(t))-slackd=l=0;
eq22(i,t)(ord(i) lt 3).. -RE(i,t)*P(i)*eta(i)*n(i)+e(i,t)-slacka(i,t)=l=0; eq23(i,t)(ord(i) eq 3)… -RE(i,t)*eta(i)*m(t)+e(i,t)-slackb(i,t)=l=0;
eq24(i,t)… slacka(i,t)=l=1e-6;
eq25(i,t)… slackb(i,t)=l=1e-6;
eq26(t)… slackc(t)=l=1e-6;
eq27… slackd=l=1e-6;



Can any body tell me why for the second case I can’t get a solution? I added the slacks because I want to convert the equalities into inequalities. If not by adding slacks, is there any other way deal with it correctly?

Thank you.



Regards,

Tina




\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Thank you Arne, I’m sorry I don’t really agree that the math is wrong.
Consider the equality x=e=0;
by adding a slack x-s=l=0, together with a constraint below
s=l=0.000001, and s is a positive variable,
I think it is possible to convert it.

I found the problem lies in eq20, I missed a “minus”.
eq20(t)… -sum(i,e(i,t))-ebd(t)-loe(t)-slackc(t)=l=-D(t);




On Fri, Feb 1, 2013 at 4:27 PM, Arne Stolbjerg Drud wrote:

Tine



You have the math wrong. You can change an inequality to an equality by adding a slack but not the other way round.



Consider the simple equality x =E= 0;



This has only one solution, namely x equal to zero. Adding a slack the way you do gives

x – s =L= 0; s =L= 0;



This set of constraints have lots of solutions, for example x = -1 and s = 0 or x = -1 and s = -1.



Regards



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, Fax: (+45) 44 49 03 33, email: adrud@arki.dk



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Tina
Sent: Friday, February 01, 2013 5:03 AM
To: gamsworld@googlegroups.com
Subject: Slack variables



Dear Members of GAMS world,



I added some slack variables to my code, then I found the problem has no solution. I can get the optimal solution before adding the slacks.

But I cannot tell the difference, and don’t know why this could happen. My code is as below:



eq20(t)… sum(i,E(i,t))+ebd(t)+loe(t)=e=D(t);
eq21… -lp+sum(t,loe(t))/sum(t,D(t))=e=0;
eq22(i,t)(ord(i) lt 3).. -RE(i,t)*P(i)*eta(i)*n(i)+e(i,t)=e=0; eq23(i,t)(ord(i) eq 3)… -RE(i,t)*P(i)*eta(i)*m(t)+e(i,t)=e=0;



then I change to



eq20(t)… -sum(i,e(i,t))-ebd(t)-loe(t)-slackc(t)=l=D(t);
eq21… -lp+sum(t,loe(t))/sum(t,D(t))-slackd=l=0;
eq22(i,t)(ord(i) lt 3).. -RE(i,t)*P(i)*eta(i)*n(i)+e(i,t)-slacka(i,t)=l=0; eq23(i,t)(ord(i) eq 3)… -RE(i,t)*eta(i)*m(t)+e(i,t)-slackb(i,t)=l=0;
eq24(i,t)… slacka(i,t)=l=1e-6;
eq25(i,t)… slackb(i,t)=l=1e-6;
eq26(t)… slackc(t)=l=1e-6;
eq27… slackd=l=1e-6;



Can any body tell me why for the second case I can’t get a solution? I added the slacks because I want to convert the equalities into inequalities. If not by adding slacks, is there any other way deal with it correctly?

Thank you.



Regards,

Tina




\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\