Hi everyone,

I’m trying to write a system into GAMS language but it’s being impossible to me. So, if anyone can help me, I really appreciate it.

The system is the next:

And it’s follow by some instructions that I attach as well.

I lost my patience trying to do this and this is all I have, but is wrong, of course. Thanks in advance.

SETS i categorias /RD, AKZ, KLM, PHI, UN/;

SETS t tiempo /1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,

27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50/;

SCALAR M objetivo medio del rendimiento /0.2/;

PARAMETERS media(i) rendimiento medio esperado

/RD -0.28

AKZ 0.33

KLM 0.4

PHI 0.3

UN 0.55

/;

TABLE d(t,i) - “with the expected values”

VARIABLES VAR, x(i), y(t);

POSITIVE VARIABLES x(i);

EQUATIONS FO, RESTRIC1, RESTRIC2, RESTRIC3;

FO… VAR =E= sum(t,0.004*(SQR(y(t))));

RESTRIC1… sum(t,y(t)) =E= sum(i,x(i)*sum(t, d(t,i)-media(i)));

RESTRIC2… sum(i,media(i)*x(i))=G=M;

RESTRIC3… sum(i,x(i))=E=1;

MODEL ejemplo1 /all/;

SOLVE ejemplo1 USING NLP MINIMIZING VAR;