Writing Sum Equations

Hi to everyone =))

I am new to gams and I know just basic notations about writing a model like set,sum,variables,equations… I wrote an objective function also costraints according to a trasportation problem but I could’nt find how will I write this summation in gams?. A part of objective function shown below;

the variable x has 5 indices named (i,j,f,v,t) the others are parameters. Also I want to ask about indices which start from different range as;
i=0,1,2,3,… n
but I want to write it just for 0 for a part of constraint as;

Could you help ? =))




\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/RunimrlmJiAJ.
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.

Take a look at the “$” (dollar) condition and the “ord” of a set at the GAMS manual.
Regards

2012/4/23 a_ergin90@hotmail.com

Hi to everyone =))

I am new to gams and I know just basic notations about writing a model like set,sum,variables,equations… I wrote an objective function also costraints according to a trasportation problem but I could’nt find how will I write this summation in gams?. A part of objective function shown below;

the variable x has 5 indices named (i,j,f,v,t) the others are parameters. Also I want to ask about indices which start from different range as;
i=0,1,2,3,… n
but I want to write it just for 0 for a part of constraint as;

Could you help ? =))




\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/RunimrlmJiAJ.
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.



\

Edson Valle
edsoncv@gmail.com


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,
If you want to write the constraint for the particular value of the indics variable i = 0. Then you have to put that i indics in double quotes.

For example,
if you want for every t, and for i =0, the value of variable x <=1000 then

define eqn(t) in the equation definition part and then write this constraint.

eqn(t)…(sum(j,f,v,t),x(“0”,j,f,v.t))=l=1000;

Best Regards,
Dharmender Yadav.


On Monday, 23 April 2012 18:36:31 UTC+5:30, a_er...@hotmail.com wrote:

Hi to everyone =))

I am new to gams and I know just basic notations about writing a model like set,sum,variables,equations… I wrote an objective function also costraints according to a trasportation problem but I could’nt find how will I write this summation in gams?. A part of objective function shown below;

the variable x has 5 indices named (i,j,f,v,t) the others are parameters. Also I want to ask about indices which start from different range as;
i=0,1,2,3,… n
but I want to write it just for 0 for a part of constraint as;

Could you help ? =))




\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/CAbNZBGgz3MJ.
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.