Page 1 of 1

Problem solving error 149

Posted: Fri Oct 15, 2021 8:21 pm
by lcarreon
Hello, I have a problem solving problem 149. I,ve already add "all" for the equation, but i still have the problem.

Code: Select all

$OFFSYMXREF
$OFFSYMLIST

option limrow=0;
option limcol=0;
option solprint=on;
option sysout=off;

option LP=CPLEX;
option MIP=CPLEX;
option NLP=CONOPT;
option MINLP=DICOPT;
option OPTCR=0;

$TITLE VMI
$ONTEXT
EJEMPLO VMI
$OFFTEXT
SETS
j periodos /a1*a5/
i compradores /b1*b10/;

VARIABLE F1;
Variable x(i,j);
TABLE d1(i,j) por periodos
        a1      a2      a3      a4      a5 
b1      20      19      18      21      18
b2      .003    .005    .008    .003    .006
b3      7       7       7       7       7
b4      .004    .006    .008    .005    .007
b5      9       9       9       9       9
b6      7       8       9       7       9
b7      12      10      11      11      12
b8      15      15      15      15      15;

EQUATIONS funobj, rest1, rest2,rest4;
funobj.. F1 =E= {(d1(i,j)*(x(i,j))-(d1(i,j))*sqrt((x(i,j)))-(d1(i,j)*(x(i,j)))-0.5*d1(i,j)*sqrt((x(i,j)))-(2*sqrt((d1(i,j)+d1(i,j))*(d1(i,j)+d1(i,j))*(x(i,j))))};
rest1..  x(i,j)=G=250;
rest2..  x(i,j)=L=4000;
rest4..  (d1("b",j))=L=14476;

model problema1 /al/;
solve problema1 using LP maximizing F1;
#

Re: Problem solving error 149

Posted: Sat Oct 16, 2021 1:27 am
by abhosekar
please follow the rules of this forum app.php/rules
and post your model in a code block so that other users can copy and run it. The way you have posted your model misaligns tables and makes it difficult for other users to run it.

- Atharv

Re: Problem solving error 149

Posted: Sat Oct 16, 2021 4:12 pm
by cnbrksnr
You need to include all of the equations in the solve statement.

Try

model problema1 /all/;

Re: Problem solving error 149

Posted: Sun Oct 17, 2021 2:31 pm
by lcarreon
hi, thanks for your help. I´ve already add "all" but I still have the problem

Re: Problem solving error 149

Posted: Sun Oct 17, 2021 4:07 pm
by abhosekar
Many errors. You have to define equations over sets such as rest1(i, j) etc.

d1("b", j) doesn't exist because d1 is defined over (i, j) and i does not have any element named b. It has b1,b2,...

The biggest problem in this formulation is funobj. In this equation you are using (i, j) but they are not defined for the scope of this equation. You can define funobj(i, j) and F1(i, j) but then you have to think what is your objective. May be you want to sum((i, j),..) on the right hand side of funobj equation.

Please read more about compilation error like this in GAMS documentation: https://www.gams.com/latest/docs/UG_Fix ... ors_ErrorG

- Atharv