Different equation types

hello everyone;

I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.












































\

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.

\

Hi ?

I can only repeat myself as it looks like you have missed all the advice below…



(Post from Deember 10th, 2012):

I get the impression that more and more questions in this mailing list are coming from “Microsoft users”:

With that, I mean users who believe that a complex program like Excel or Gams can be mastered by just clicking around and that manuals are for Dummies.



So here some urgent advice before you post a question:

  1. RTFM: Read the fucking manual from page 1 to the end (or at least chapter 1 with the introductory example)
    
  2. If you still have a problem: Search the Mccarl User Guide.
    
  3. If you still have a problem: Search the two mailing lists.
    
  4. If you still have a problem: Try to solve your problem in a smaller, more manageable model (“Toy model”).
    
  5. If you still have a problem:
    

a. Formulate your question in a clear and concise way.

b. Add the code and if available the errors Gams reported.

c. Start your E-Mail with a greeting.

d. End it with your name.



Cheers

Renger van Nieuwkoop





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Maryam Bodaghi
Sent: Monday, April 1, 2013 2:40 PM
To: gamsworld@googlegroups.com
Subject: Different equation types



hello everyone;



I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.
















































\

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.

\

hi,

=e= Equality: rhs must equal lhs
=g= Greater than: lhs must be greater than or equal to rhs
=l= Less than: lhs must be less than or equal to rhs

See Chapter 8 of “Gams User Guide” in Help tab.

From: Maryam Bodaghi
To: gamsworld@googlegroups.com
Sent: Monday, April 1, 2013 5:09 PM
Subject: Different equation types

hello everyone;

I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.























\

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.

\

Dear Renger;
In my subject to part, I have 3 types equation. So I cant define them in equation.
my problem is as attached.
and my codes are as below:


SETS
J COSTS/C1C8/
I CONSTRAINTS/K1
K14/;
PARAMETERS
K(I)
/K1 400
K2 250
K3 250
K4 230
K5 240
K6 250
K7 0
K8 160
K9 190
K10 0
K11 250
K12 230
K13 240
K14 250/
C(J)
/C1 2
C2 17
C3 20
C4 28
C5 0
C6 0
C7 0
C8 0/;
TABLE A(I,J)
C1 C2 C3 C4 C5 C6 C7 C8
K1 1 1 1 1 0 0 0 0
K2 0 0 0 0 1 1 1 1
K3 1 0 0 0 0 0 0 0
K4 0 1 0 0 0 0 0 0
K5 0 0 1 0 0 0 0 0
K6 0 0 0 1 0 0 0 0
K7 0 0 0 0 1 0 0 0
K8 0 0 0 0 0 1 0 0
K9 0 0 0 0 0 0 1 0
K10 0 0 0 0 0 0 0 1
K11 1 0 0 0 1 0 0 0
K12 0 1 0 0 0 1 0 0
K13 0 0 1 0 0 0 1 0
K14 0 0 0 1 0 0 0 1;
VARIABLES
PRICE
POSITIVE VARIABLES
P(J);
EQUATION
OBJECTIVE
Y(I);
OBJECTIVE… PRICE=E=SUM(J , C(J)*P(J));
Y(1)… SUM (J , A(1,J) * P(J))=E=K(1)
Y(2)… SUM (J , A(2,J)*P(J))=G=K(2)
Y(3)… SUM (J , A(3,J)*P(J))=L=K(3)
Y(4)… SUM (J , A(4,J)*P(J))=L=K(4)
Y(5)… SUM (J , A(5,J)*P(J))=L=K(5)
Y(6)… SUM (J , A(6,J)*P(J))=L=K(6)
Y(7)… SUM (J , A(7,J)*P(J))=E=K(7)
Y(8)… SUM (J , A(8,J)*P(J))=L=K(8)
Y(9)… SUM (J , A(9,J)*P(J))=L=K(9)
Y(10)… SUM (J , A(10,J)*P(J))=E=K(10)
Y(11)… SUM (J , A(11,J)*P(J))=L=K(11)
Y(12)… SUM (J , A(12,J)*P(J))=L=K(12)
Y(13)… SUM (J , A(13,J)*P(J))=L=K(13)
Y(14)… SUM (J , A(14,J)*P(J))=L=K(14);
MODEL TEST / ALL /;
SOLVE TEST USING MINIMIZING PRICE;
DISPLAY P.L ,P.M;



Regards
Maryam




On Mon, Apr 1, 2013 at 5:52 PM, Renger van Nieuwkoop wrote:

Hi ?

I can only repeat myself as it looks like you have missed all the advice below…



(Post from Deember 10th, 2012):

I get the impression that more and more questions in this mailing list are coming from “Microsoft users”:

With that, I mean users who believe that a complex program like Excel or Gams can be mastered by just clicking around and that manuals are for Dummies.



So here some urgent advice before you post a question:

  1. RTFM: Read the fucking manual from page 1 to the end (or at least chapter 1 with the introductory example)
    
  2. If you still have a problem: Search the Mccarl User Guide.
    
  3. If you still have a problem: Search the two mailing lists.
    
  4. If you still have a problem: Try to solve your problem in a smaller, more manageable model (“Toy model”).
    
  5. If you still have a problem:
    

a. Formulate your question in a clear and concise way.

b. Add the code and if available the errors Gams reported.

c. Start your E-Mail with a greeting.

d. End it with your name.



Cheers

Renger van Nieuwkoop





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Maryam Bodaghi
Sent: Monday, April 1, 2013 2:40 PM
To: gamsworld@googlegroups.com
Subject: Different equation types



hello everyone;



I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.
















































\

Doc1.docx (42.6 KB)

Hi Maryam



Yuu can write the equation Y(i) as follows;



Y(I)… SUM (J , A(I,J) * P(J))=E=K(I)



Have a closer look at the first chapter of the Gams manual. Here you will see how to use an index in an equation.



There are still some mistakes in your model, but that is up to you.

Cheers



Renger







Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Maryam Bodaghi
Gesendet: Montag, 1. April 2013 16:53
An: gamsworld@googlegroups.com
Betreff: Re: Different equation types



Dear Renger;

In my subject to part, I have 3 types equation. So I cant define them in equation.

my problem is as attached.

and my codes are as below:




SETS
J COSTS/C1C8/
I CONSTRAINTS/K1
K14/;
PARAMETERS
K(I)
/K1 400
K2 250
K3 250
K4 230
K5 240
K6 250
K7 0
K8 160
K9 190
K10 0
K11 250
K12 230
K13 240
K14 250/
C(J)
/C1 2
C2 17
C3 20
C4 28
C5 0
C6 0
C7 0
C8 0/;
TABLE A(I,J)
C1 C2 C3 C4 C5 C6 C7 C8
K1 1 1 1 1 0 0 0 0
K2 0 0 0 0 1 1 1 1
K3 1 0 0 0 0 0 0 0
K4 0 1 0 0 0 0 0 0
K5 0 0 1 0 0 0 0 0
K6 0 0 0 1 0 0 0 0
K7 0 0 0 0 1 0 0 0
K8 0 0 0 0 0 1 0 0
K9 0 0 0 0 0 0 1 0
K10 0 0 0 0 0 0 0 1
K11 1 0 0 0 1 0 0 0
K12 0 1 0 0 0 1 0 0
K13 0 0 1 0 0 0 1 0
K14 0 0 0 1 0 0 0 1;
VARIABLES
PRICE
POSITIVE VARIABLES
P(J);
EQUATION
OBJECTIVE
Y(I);
OBJECTIVE… PRICE=E=SUM(J , C(J)*P(J));
Y(1)… SUM (J , A(1,J) * P(J))=E=K(1)
Y(2)… SUM (J , A(2,J)*P(J))=G=K(2)

Y(3)… SUM (J , A(3,J)*P(J))=L=K(3)
Y(4)… SUM (J , A(4,J)*P(J))=L=K(4)
Y(5)… SUM (J , A(5,J)*P(J))=L=K(5)
Y(6)… SUM (J , A(6,J)*P(J))=L=K(6)
Y(7)… SUM (J , A(7,J)*P(J))=E=K(7)
Y(8)… SUM (J , A(8,J)*P(J))=L=K(8)
Y(9)… SUM (J , A(9,J)*P(J))=L=K(9)
Y(10)… SUM (J , A(10,J)*P(J))=E=K(10)
Y(11)… SUM (J , A(11,J)*P(J))=L=K(11)
Y(12)… SUM (J , A(12,J)*P(J))=L=K(12)
Y(13)… SUM (J , A(13,J)*P(J))=L=K(13)
Y(14)… SUM (J , A(14,J)*P(J))=L=K(14);
MODEL TEST / ALL /;
SOLVE TEST USING MINIMIZING PRICE;
DISPLAY P.L ,P.M;







Regards

Maryam







On Mon, Apr 1, 2013 at 5:52 PM, Renger van Nieuwkoop wrote:

Hi ?

I can only repeat myself as it looks like you have missed all the advice below…



(Post from Deember 10th, 2012):

I get the impression that more and more questions in this mailing list are coming from “Microsoft users”:

With that, I mean users who believe that a complex program like Excel or Gams can be mastered by just clicking around and that manuals are for Dummies.



So here some urgent advice before you post a question:

  1. RTFM: Read the fucking manual from page 1 to the end (or at least chapter 1 with the introductory example)
    
  2. If you still have a problem: Search the Mccarl User Guide.
    
  3. If you still have a problem: Search the two mailing lists.
    
  4. If you still have a problem: Try to solve your problem in a smaller, more manageable model (“Toy model”).
    
  5. If you still have a problem:
    

a. Formulate your question in a clear and concise way.

b. Add the code and if available the errors Gams reported.

c. Start your E-Mail with a greeting.

d. End it with your name.



Cheers

Renger van Nieuwkoop





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Maryam Bodaghi
Sent: Monday, April 1, 2013 2:40 PM
To: gamsworld@googlegroups.com
Subject: Different equation types



hello everyone;



I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.
















































\

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.




\

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.

\

Dear Hajinejhad;
I know these but in equation,we shoud define a matrix.if there wewr only “graeter than” or “smaller than” it was ok. but here we should define each row of matrix seperately, and I don’t know how???
woud you please see the file attached?


On Mon, Apr 1, 2013 at 6:22 PM, Hajinezhad wrote:

hi,

=e= Equality: rhs must equal lhs
=g= Greater than: lhs must be greater than or equal to rhs
=l= Less than: lhs must be less than or equal to rhs

See Chapter 8 of “Gams User Guide” in Help tab.

From: Maryam Bodaghi
To: gamsworld@googlegroups.com
Sent: Monday, April 1, 2013 5:09 PM
Subject: Different equation types

hello everyone;

I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.























\

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.



\

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.

\

There is no attached file. However, if equations are “grater than” or “smaller than”, you can multiply rows associated with “grater than” by -1, so all of equations are
To: gamsworld@googlegroups.com
Sent: Monday, April 1, 2013 8:06 PM
Subject: Re: Different equation types

Dear Hajinejhad;
I know these but in equation,we shoud define a matrix.if there wewr only “graeter than” or “smaller than” it was ok. but here we should define each row of matrix seperately, and I don’t know how???
woud you please see the file attached?


On Mon, Apr 1, 2013 at 6:22 PM, Hajinezhad wrote:

hi,

=e= Equality: rhs must equal lhs
=g= Greater than: lhs must be greater than or equal to rhs
=l= Less than: lhs must be less than or equal to rhs

See Chapter 8 of “Gams User Guide” in Help tab.

From: Maryam Bodaghi
To: gamsworld@googlegroups.com
Sent: Monday, April 1, 2013 5:09 PM
Subject: Different equation types

hello everyone;

I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.























\

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.



\

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.

\

You could define subsets for the greater, equal and less than and define 3 equations YE, YG, YL over these sets.

Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Maryam Bodaghi
Gesendet: Montag, 1. April 2013 17:36
An: gamsworld@googlegroups.com
Betreff: Re: Different equation types



Dear Hajinejhad;

I know these but in equation,we shoud define a matrix.if there wewr only “graeter than” or “smaller than” it was ok. but here we should define each row of matrix seperately, and I don’t know how???

woud you please see the file attached?



On Mon, Apr 1, 2013 at 6:22 PM, Hajinezhad wrote:

hi,



=e= Equality: rhs must equal lhs

=g= Greater than: lhs must be greater than or equal to rhs

=l= Less than: lhs must be less than or equal to rhs



See Chapter 8 of “Gams User Guide” in Help tab.



From: Maryam Bodaghi
To: gamsworld@googlegroups.com
Sent: Monday, April 1, 2013 5:09 PM
Subject: Different equation types



hello everyone;



I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.
















































\

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.




\

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.

\

Thanks indeed dear Hajinezhad, that was so helpeful


On Mon, Apr 1, 2013 at 9:02 PM, Renger van Nieuwkoop wrote:

You could define subsets for the greater, equal and less than and define 3 equations YE, YG, YL over these sets.

Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von Maryam Bodaghi
Gesendet: Montag, 1. April 2013 17:36

An: gamsworld@googlegroups.com
Betreff: Re: Different equation types



Dear Hajinejhad;

I know these but in equation,we shoud define a matrix.if there wewr only “graeter than” or “smaller than” it was ok. but here we should define each row of matrix seperately, and I don’t know how???

woud you please see the file attached?



On Mon, Apr 1, 2013 at 6:22 PM, Hajinezhad wrote:

hi,



=e= Equality: rhs must equal lhs

=g= Greater than: lhs must be greater than or equal to rhs

=l= Less than: lhs must be less than or equal to rhs



See Chapter 8 of “Gams User Guide” in Help tab.



From: Maryam Bodaghi
To: gamsworld@googlegroups.com
Sent: Monday, April 1, 2013 5:09 PM
Subject: Different equation types



hello everyone;



I have different equation types( greater than, smaller than and equality) in may ‘’ subject to " part and I don’t know how to define them.
















































\

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.




\

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.



\

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.

\