Uncontrolled set entered as constant

Problems with syntax of GAMS
Post Reply
TheBebbo
User
User
Posts: 16
Joined: 2 years ago

Uncontrolled set entered as constant

Post by TheBebbo »

Hi!
in the following i present you what I wanna do and what my problem is


1 Set t time /1*5/ ;

2 Parameters

C(t) ExampleP1_time_t / 1 33, 2 24, 3 90, 4 12, 5 43/
F(t) ExampleP2_time_t / 1 4, 2 8, 3 10, 4 6, 5 8/;

Variable G objective function;

Positive Variable
R(t) ExampeV1
B(t) ExampleV2

Equation Obj objective function;
Obj.. G=e= sum(t, C(t) + F(t) + R(t) - B(t));

Equation RS restriction;
RS.. R(t) =l= B(t) * F(t) ---> Error Uncontrolled set entered as constant

So i wanna determine a restriction that R(t=1) =l= B(t=1) * F(t=1)
R(t=2) =l= B(t=2) * F(t=2) ... for all values of T in on restriction equation

I´m new in the world of GAMS and I´m very thankful vor any advice:

Greetings
RayBradbury98
User
User
Posts: 1
Joined: 2 years ago

Re: Uncontrolled set entered as constant

Post by RayBradbury98 »

Hi TheBebbo,

you may have made a common mistake in the equations section.
When defining an equation, in your case RS, you must write for which set it is defined, that in your case is t.

So instead of writing:
RS.. R(t) =l= B(t) * F(t)

you should write it this way:
RS(t).. R(t) =l= B(t) * F(t)

Hope it works.

Bests

RayBradbury98
TheBebbo
User
User
Posts: 16
Joined: 2 years ago

Re: Uncontrolled set entered as constant

Post by TheBebbo »

It works! Thank you so much :)
Post Reply