Mr. Dehghani,
Dollar options are covered in the GAMS User’s Guide: look in chapter 11. Also, take the ramsey model out of GAMSLIB and understand what is going on with that: it is a good illustration of how dynamic subsets and the dollar operator can be used to good advantage. Invest some time with the ramsey model - it is worth it.
Frank Layton
On Tue, Mar 12, 2013 at 8:36 AM, Mohamad Dehghani wrote:
Im not familier with ( $ord) code.I searched mccarl user guide but i was unable to find any useful info about it.Can you please explain more about the code or give me a pdf where this matter is being explained or maybe introduce a webpage that can help me on this??
Thank you very much.you have helped me greatly.thank you again
On Tue, Mar 12, 2013 at 6:13 PM, soheila Kavosh wrote:
you should use condition on index.
for example sum((i,j)$ord(i) eq 1,f(i,j)
in this case you calculate distance between source i with other destination.
$ord help you for act condition on equations.
On 3/12/13, Mohamad Dehghani wrote:
Firstly, Thank you for your response.
My problem is that I cannot relate my variable with the table :
sets
i index for water source /1,2,3 /
j index for water demand /1,2,3,4,5/
parameters
s(i) …
D(j) …
table distance (i,j) the distance between them
1 2 3 4 5
1
2
3 ;
variables
f(i,j) flowrate
total …
.
.
.
equations
ftot
total=sum((i,j),f(i,j)) ;
.
.
.
in such code,how can i write a code for the software to only calculate the
distance between those sources and demands that it uses in the “total”
calculation.I tried to introduce a separate equation for the distance but
it calculates the distance between all sources and demands regardless of
wether these sources are used in flow rate calculation or not.
On Tuesday, March 12, 2013 4:16:44 PM UTC+8, Soheila wrote:
gams only use F(i,j). rest of that are comment.
On 3/12/13, Mohamad Dehghani > wrote:
Hello,
I want to know that when introducing GAMS ( example : F(i,j) flow of
water
from source i to demand j ) ,does GAMS only sees F(i,j) as a variable
and
the rest as an comment or does it uses the ( flow of water from source i
to
demand j ) for the model ?
thank you very much
–
You received this message because you are subscribed to the Google
Groups
“gamsworld” group.
To unsubscribe from this group and stop receiving emails from it, send
an
email to gamsworld+...@googlegroups.com .
To post to this group, send email to
gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
–
“gamsworld” group.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
\