Dear all,

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.

fr(i,m,k) and F(i,k) are variables. How should I constrain that in

GAMS?

Thanks!

Regards,

YN

\

Dear all,

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.

fr(i,m,k) and F(i,k) are variables. How should I constrain that in

GAMS?

Thanks!

Regards,

YN

\

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.

fr(i,m,k) and F(i,k) are variables. How should I constrain that in GAMS?

Equations

Equation1(i,m,k),

Equation2(i,m,k)

;

Equation1(i,m,k) (fr(i,m,k)=0) .. F(i,k)=0; Equation2(i,m,k) (F(i,k)=0) … fr(i,m,k)=0;

HTH,

Yan

\

Hi YN,

How about the following formulations?

- If your variables are both positive, the following formulations may work for you.

0 wrote:

Dear all,

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.

fr(i,m,k) and F(i,k) are variables. How should I constrain that in

GAMS?

Thanks!

Regards,

YN

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.

\

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.

Hi Destin,

If I defined fr and F to be positive variables, do I still need to constrain they as >=0 in equations?

Thanks!

On Jun 7, 2012 7:43 PM, “Destin Zed” wrote:

Hi YN,

How about the following formulations?

- If your variables are both positive, the following formulations may work for you.
0 0

The first formulation ensures that when fr(i,m,k) is zero, F(i,k) is automatically evaluated to zero and so does the second formulation.

- If the variables are free with [-INF, INF], you may attempt the problem in a tricky way. Suppose you have bijections of the variables (i.e. positive and negative parts).
fr(i,m,k) = fr_PLUS(i,m,k) - fr_MINUS(i,m,k)

F(i,k) = F_PLUS(i,k) - F_MINUS(i,k)where fr_PLUS(i,m,k), fr_MINUS(i,m,k), F_PLUS(i,k) and F_MINUS(i,k) are all positive variables.

-L1

fr_MINUS(i,m,k) -L2F_MINUS(i,k)

Your requirements are also satisfied here. When fr(i,m,k) is zero which leads to both positive and negative parts zero, F(i,k) is automatically evaluated to zero and similar in the second formulation.

HTH.

DestinOn Thu, Jun 7, 2012 at 10:36 AM, Nan Yu wrote:

Dear all,

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.fr(i,m,k) and F(i,k) are variables. How should I constrain that in

GAMS?Thanks!

Regards,

YN–

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

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.

–

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.

Hi Yan,

Thanks for ur Reply.

But I’m not sure whether fr and F can be used in dollar conditions as fr and F are variables?

Regards,

Yu Nan

On Jun 7, 2012 7:43 PM, “ä»»å½¦” wrote:

\

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.

fr(i,m,k) and F(i,k) are variables. How should I constrain that in GAMS?

Equations

Equation1(i,m,k),

Equation2(i,m,k)

;

Equation1(i,m,k) (fr(i,m,k)=0) .. F(i,k)=0; Equation2(i,m,k) (F(i,k)=0) … fr(i,m,k)=0;

HTH,

Yan

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.

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.

Hi YN,

You may add fr.lo(indices) = 0 and F.lo(indices) = 0 to your model but they are obviously redundant constraints once you have declared the variables as positive variables a priori. Remember you need 0 wrote:

Hi Destin,

If I defined fr and F to be positive variables, do I still need to constrain they as >=0 in equations?

Thanks!

On Jun 7, 2012 7:43 PM, “Destin Zed” wrote:

Hi YN,

How about the following formulations?

- If your variables are both positive, the following formulations may work for you.
0 0

The first formulation ensures that when fr(i,m,k) is zero, F(i,k) is automatically evaluated to zero and so does the second formulation.

- If the variables are free with [-INF, INF], you may attempt the problem in a tricky way. Suppose you have bijections of the variables (i.e. positive and negative parts).
fr(i,m,k) = fr_PLUS(i,m,k) - fr_MINUS(i,m,k)

F(i,k) = F_PLUS(i,k) - F_MINUS(i,k)where fr_PLUS(i,m,k), fr_MINUS(i,m,k), F_PLUS(i,k) and F_MINUS(i,k) are all positive variables.

-L1

fr_MINUS(i,m,k) -L2F_MINUS(i,k)

Your requirements are also satisfied here. When fr(i,m,k) is zero which leads to both positive and negative parts zero, F(i,k) is automatically evaluated to zero and similar in the second formulation.

HTH.

DestinOn Thu, Jun 7, 2012 at 10:36 AM, Nan Yu wrote:

Dear all,

I wanna write this constraint.

if fr(i,m,k)=0, then F(i,k)=0;

if F(i,k)=0, then fr(i,m,k)=0.fr(i,m,k) and F(i,k) are variables. How should I constrain that in

GAMS?Thanks!

Regards,

YN

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.

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.

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.

\

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.