sets
         j /1*8/
         k /1*8/
         l /1*8/;   
...

parameter
         s(i) DEFINED;      
...

variables
         x(j,k,l)
         y;

equations
...
        definey(j,k,l) y calcucation

...
        definey(j,k,l) ?????

in Gams, how should I express the following inequality after definey(j,k,l);

sum(i=0 through l-1) s_i * x_{j,k,l}  >=  y  for all j,k,l

I don't know how the above i should be defined in SETS and how to express the above inequality.

Thank you very much in advance.

asked 04 Nov '13, 21:47

Mike390's gravatar image

Mike390
214
accept rate: 0%

edited 05 Nov '13, 04:18

fbahr's gravatar image

fbahr ♦
4.6k716


You define the set i separately in your sets section and do as follows.

Set i/1*n/;

definey(j,k,l).. y =l= sum(i$(ord(i) lt l), s(i)) * x(j,k,l);

Please note that as x(j,k,l) is not part of the summation over i, you can bring it out of the summation.

link

answered 05 Nov '13, 00:48

Ehsan's gravatar image

Ehsan ♦
4.8k31122
accept rate: 16%

Thanks very much. That helps me a lot.

(05 Nov '13, 10:10) Mike390
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×51
×2

Asked: 04 Nov '13, 21:47

Seen: 1,658 times

Last updated: 05 Nov '13, 10:50

OR-Exchange! Your site for questions, answers, and announcements about operations research.