how use of "if" in constraint

Dear All,

I want to use “if” in constraint of my model,please tell me how can do it ?

if t>19 inc(t)=k(t) els inc(t)=0

Thank You
Mehrdad


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.

\

Dear Mehrdad,

Assuming that inc(t) is the decision variable, then you can do:

OPTION 1: Constraint + FX attribute:

constraint(t)$(ORD(t) > 19)… inc(t) =E= k(t) ;

inc.FX(t)$(ORD(t) 19)… inc(t) =E= k(t);


Cheers,
Pedro


On Mon, May 13, 2013 at 3:48 PM, Mehrdad Tahmasebi wrote:

Dear All,

I want to use “if” in constraint of my model,please tell me how can do it ?

if t>19 inc(t)=k(t) els inc(t)=0

Thank You
Mehrdad


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.





\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119


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.

\

Dear Mehrdad,

I think this works.

Inc(t)=k(t)(t>19)+0(t le 19)



Bests,

Yonas



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Mehrdad Tahmasebi
Sent: 13. mai 2013 16:49
To: gamsworld@googlegroups.com
Subject: how use of “if” in constraint



Dear All,



I want to use “if” in constraint of my model,please tell me how can do it ?



if t>19 inc(t)=k(t) els inc(t)=0



Thank You

Mehrdad


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.

\

Hi Mehrdad,

It should work:

Set
t ‘time period’ \t1*t%some_number%;

Parameter
k(t) ‘some parameter’;

if(ord(t)>19,
inc(t) = k(t);
else
inc(t) = 0;
);

Good luck.
Regards,
Maruf


On Mon, May 13, 2013 at 10:07 AM, yonas@GMAIL wrote:

Dear Mehrdad,

I think this works.

Inc(t)=k(t)(t>19)+0(t le 19)



Bests,

Yonas



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Mehrdad Tahmasebi
Sent: 13. mai 2013 16:49
To: gamsworld@googlegroups.com
Subject: how use of “if” in constraint



Dear All,



I want to use “if” in constraint of my model,please tell me how can do it ?



if t>19 inc(t)=k(t) els inc(t)=0



Thank You

Mehrdad


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.





\

Mohammad Marufuzzaman
Industrial & Systems Engineering
Mississippi State University, USA
E-mail: maruf237@gmail.com


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 Pedro.


On Mon, May 13, 2013 at 11:04 PM, Pedro Javier Ramírez Torrealba wrote:

Dear Mehrdad,

Assuming that inc(t) is the decision variable, then you can do:

OPTION 1: Constraint + FX attribute:

constraint(t)$(ORD(t) > 19)… inc(t) =E= k(t) ;

inc.FX(t)$(ORD(t) 19)… inc(t) =E= k(t);


Cheers,
Pedro


On Mon, May 13, 2013 at 3:48 PM, Mehrdad Tahmasebi wrote:

Dear All,

I want to use “if” in constraint of my model,please tell me how can do it ?

if t>19 inc(t)=k(t) els inc(t)=0

Thank You
Mehrdad


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.





\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119


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 Yonas.


On Mon, May 13, 2013 at 11:07 PM, yonas@GMAIL wrote:

Dear Mehrdad,

I think this works.

Inc(t)=k(t)(t>19)+0(t le 19)



Bests,

Yonas



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Mehrdad Tahmasebi
Sent: 13. mai 2013 16:49
To: gamsworld@googlegroups.com
Subject: how use of “if” in constraint



Dear All,



I want to use “if” in constraint of my model,please tell me how can do it ?



if t>19 inc(t)=k(t) els inc(t)=0



Thank You

Mehrdad


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.

\

Thank you Mohammad.


On Mon, May 13, 2013 at 11:19 PM, Mohammad Marufuzzaman wrote:

Hi Mehrdad,

It should work:

Set
t ‘time period’ \t1*t%some_number%;

Parameter
k(t) ‘some parameter’;

if(ord(t)>19,
inc(t) = k(t);
else
inc(t) = 0;
);

Good luck.
Regards,
Maruf


On Mon, May 13, 2013 at 10:07 AM, yonas@GMAIL wrote:

Dear Mehrdad,

I think this works.

Inc(t)=k(t)(t>19)+0(t le 19)



Bests,

Yonas



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Mehrdad Tahmasebi
Sent: 13. mai 2013 16:49
To: gamsworld@googlegroups.com
Subject: how use of “if” in constraint



Dear All,



I want to use “if” in constraint of my model,please tell me how can do it ?



if t>19 inc(t)=k(t) els inc(t)=0



Thank You

Mehrdad


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.





\

Mohammad Marufuzzaman
Industrial & Systems Engineering
Mississippi State University, USA
E-mail: maruf237@gmail.com


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.

\