equation control

Problems with syntax of GAMS
yanzhiping
User
User
Posts: 85
Joined: 9 months ago

equation control

Postby yanzhiping » 2 months ago

I have a conditional equation r1 depending on set q1, the equation r1 is controlled by the set b. if b is empty, then no r1 needed.
I used the following code, but it is not working.

Code: Select all

set q1(a,b,c,d,e)
equation r1(a,b,c,d,e)
r1(a,b,c,d,e)$b..
How may I control the equation correctly?

Thanks.

cladelpino
User
User
Posts: 55
Joined: 10 months ago

Re: equation control

Postby cladelpino » 1 month ago

Hi Yan: Check out this example, inspired with the help of the great Erwin at http://yetanothermathprogrammingconsult ... y-set.html

Code: Select all

$onempty

set a /a1*a10/

set b(*) / /;

variable x(a),dummy;

equation r1,fobj;

r1(a,b)..       x(a)=e=1;
fobj..         dummy=e=1;

model c /all/;
solve c using lp minimizing dummy;


Who is online

Users browsing this forum: No registered users and 1 guest