working with sets and subsets and using them in equations

Hello,I am a beginner in Gams.In a project,I got a problem with my code.
I have defined some subsets.But I don’t know how to use it in an equation.
for example:
G is a set and sub1(G) is a subset.
I want to have an equation like this:
E(sub1(G))…sum(P,X(sub1(G),P))=L=1;
X(G,P) is my variable.
I am not familiar with the right format and don’t know what to do.If needed I can give you a brief description of my program.

Best Regards
Farnaz


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.

Hi Farnaz

You should declare your equation over the overall set (G):





Equations

E(G)

;



And then use it as:

E(sub1)…sum(P,X(sub1,P))=L=1;



Hope this helps.

Cheers

Renger


\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch







From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Farnaz Babaie
Sent: Thursday, October 23, 2014 11:30 PM
To: gamsworld@googlegroups.com
Subject: working with sets and subsets and using them in equations



Hello,I am a beginner in Gams.In a project,I got a problem with my code.

I have defined some subsets.But I don’t know how to use it in an equation.
for example:
G is a set and sub1(G) is a subset.
I want to have an equation like this:
E(sub1(G))…sum(P,X(sub1(G),P))=L=1;

X(G,P) is my variable.
I am not familiar with the right format and don’t know what to do.If needed I can give you a brief description of my program.



Best Regards

Farnaz


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.


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.