I wanted to solve one model to ilustrate how to use GAMS in a simple problem, but I think I’ve got an error.

When I had tried minimize the equation I got one value (3), but when tried maximize I’ve got the same value (3).

Can someone explain this?

$title Example

$Ontext

$Offtext

SETS

i conjunto dos indices de X /1,2,3/;

PARAMETERS

X(i) /1 = 2, 2 = 3, 3 = 6/;

VARIABLES

Y ;

EQUATIONS

Eq1 EquaÃ§Ã£o do primeiro grau;

Eq1(i)… Y =e= X(i) + 1;

MODEL TESTE /ALL/ ;

SOLVE TESTE USING LP MINIMIZING Y;

DISPLAY Y.L;

SCALAR Min;

Min = Y.L;

SOLVE TESTE USING LP MAXIMIZING Y;

SCALAR Max;

Max= Y.L;

DISPLAY Max, Min;

–

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/tJEOJPB02o0J.

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.

Reply-to: gamsworld@googlegroups.com

Hi Friends,

I need one favor from you. I solved one MIP problem in excell. I want to solve it in GAMS. I am wondering if anybody has the codes of the problem in GAMS. Here I attached the question of the problem and the solution in excell.

Thanks a lot for your kind help.

With best regards,

Bedarul

On Tue, Dec 4, 2012 at 2:33 PM, Philipe Rocha wrote:

I wanted to solve one model to ilustrate how to use GAMS in a simple problem, but I think I’ve got an error.

When I had tried minimize the equation I got one value (3), but when tried maximize I’ve got the same value (3).

Can someone explain this?

$title Example

$Ontext

$Offtext

SETS

i conjunto dos indices de X /1,2,3/;

PARAMETERS

X(i) /1 = 2, 2 = 3, 3 = 6/;

VARIABLES

Y ;

EQUATIONS

Eq1 EquaÃ§Ã£o do primeiro grau;

Eq1(i)… Y =e= X(i) + 1;

MODEL TESTE /ALL/ ;

SOLVE TESTE USING LP MINIMIZING Y;

DISPLAY Y.L;

SCALAR Min;

Min = Y.L;

SOLVE TESTE USING LP MAXIMIZING Y;

SCALAR Max;

Max= Y.L;

DISPLAY Max, Min;

–

MILP.xlsx (18.5 KB)

mip_problem.docx (14.3 KB)