how to model my problem

Dear,

I am Korean and University student.

I begin to learn how to use GAMS by youtube and tutorial.

I have the precise mathematical model and I apply this model to my original problem.

I understand the formulas thoroughly, but I can’t express something that I can’t understand. (My English is not good)

If you show me this example how to code, It would be very appreciated.

I really want to learn GAMS, and help me.




\

variable391.PNG
example391.PNG
GAMS391.txt (1.35 KB)
model391.PNG

Sets node /n1*n5/

Sets time /t1*t20/;

Alias (node, i, j, k);

Alias (time, t);

Parameters Turn(time) ;
Turn(time)=ord(time) ;

Parameters f(k) /n1 40, n2 0, n3 20, n4 0, n5 0 / ;
Parameters v(k) /n1 40, n2 10, n3 20, n4 10, n5 60 /;

Table c(Node, Node)
n1 n2 n3 n4 n5
n1 0 1 0 0 0
n2 4 0 0 2 3
n3 0 0 0 2 0
n4 0 2 3 0 1
n5 0 3 0 1 0 ;

Table r(Node, Node)
n1 n2 n3 n4 n5
n1 0 1 0 0 0
n2 1 0 0 1 1
n3 0 0 0 1 0
n4 0 1 1 0 4
n5 0 1 0 4 0 ;

Scalars N /5/ ;
Scalars M /20/;

Variables
Z
O(t)
x(i, node, j)
p(node, time) ;

Positive Variables x;

Equations Eq1, Eq2(t), Eq3(k), Eq4(k,t), Eq5(i,j,t), Eq6(k,t);

Eq1… Z =e= sum(t, (M+1-Turn(t))*O(t));

??? below error with dimensions
Eq2(t)… O(t) =e= sum(i$(ord(i):

Dear,

I am Korean and University student.

I begin to learn how to use GAMS by youtube and tutorial.

I have the precise mathematical model and I apply this model to my original problem.

I understand the formulas thoroughly, but I can’t express something that I can’t understand. (My English is not good)

If you show me this example how to code, It would be very appreciated.

I really want to learn GAMS, and help me.


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.
For more options, visit https://groups.google.com/d/optout.



With kindly regards!
Andre Savitsky
E-mail:andresavit@yandex.ru
andre_savit@yahoo.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.
For more options, visit https://groups.google.com/d/optout.

Last time, I attach the file, name is “model.png”, it is a precise model.

I want you to check the file “model” and advise me how to model this mathematical formula.

I’m also struck at Eq2 and trying to revise the code correctly.

Thank you for your answers and continue your interest in my code, please.

*I attach file this time.




\

example.PNG
model.PNG
code.gms (1.57 KB)