Search found 30 matches

by parag_patil
2 years ago
Forum: Syntax
Topic: Problem with decision variable and cost function
Replies: 4
Views: 2885

Re: Problem with decision variable and cost function

Yes. You are correct.

I tried with it. And indeed it is like using $ over variables.

Thanks for your advice. I have to use the condition , which you have provided.

Thanks alot again.
by parag_patil
2 years ago
Forum: Syntax
Topic: Problem with decision variable and cost function
Replies: 4
Views: 2885

Re: Problem with decision variable and cost function

Hi Atharv, Thanks for your answer. Your answer is absolutely what I needed. Yes, I wrote it by mistake (repeared Y), thanks that you have corrected it. Meanwhile, before your answer was being posted , I thought the following : y(t) =e= [{[sum(X,Y(X,t)) = 0 ] AND 0} AND 0 ] Can you please see if it m...
by parag_patil
2 years ago
Forum: Syntax
Topic: Problem with decision variable and cost function
Replies: 4
Views: 2885

Problem with decision variable and cost function

Dear all, I have a binary decision variable, y(X,t) as follows: sets t /t1*t5/ X /X1*X2/ ; binary variable y(X,t); As it can be seen, the variable y(X,t) can take 1 or 0 value for all X set. In other words: y(X,t) can take as follows (an example): X1 X2 t1 0 0 t2 1 0 t3 0 1 t4 1 1 t5 1 1 I want to ...
by parag_patil
2 years ago
Forum: Syntax
Topic: How to define decision variable with fixed numbers?
Replies: 2
Views: 2204

Re: How to define decision variable with fixed numbers?

Thanks alot for your answer.

It was an easy and straightforward . But could not struck me.

Thanks again
by parag_patil
2 years ago
Forum: Syntax
Topic: How to define decision variable with fixed numbers?
Replies: 2
Views: 2204

How to define decision variable with fixed numbers?

Dear all, I am solving an optimization problem with MINLP in nature. I am facing a small problem here. My decision variable is 'X'. But this X can only choose a value from 0 , 0.25, 0.50 and 1. So basically, it is not a discrete variable. In MATLAB , I could have defined an if-else loop, saying if '...
by parag_patil
2 years ago
Forum: Syntax
Topic: assign parameter value using gams
Replies: 4
Views: 2979

Re: assign parameter value using gams

I agree with you !
by parag_patil
2 years ago
Forum: Syntax
Topic: assign parameter value using gams
Replies: 4
Views: 2979

Re: assign parameter value using gams

bussieck wrote: 2 years ago

Code: Select all

A(i) = sum(j$(ord(j)=1),Rf(j, i);
-Michael

Thanks a lot. It really saved my time. Can you please suggest me, where can I get such examples where I can learn similar to what you have said ? I am familiar to MATLAB, therefore, I am not able to do / think directly as you !
by parag_patil
2 years ago
Forum: Syntax
Topic: assign parameter value using gams
Replies: 4
Views: 2979

assign parameter value using gams

Hello, I want to assign the row value of 2D parameter to 1D parameter as follows: set i /i1*i4/ , j /j1,j2/; Parameter A(i); Table Rf(j,i) i1 i2 i3 i4 j1 1 2 3 4 j2 8 7 9 8; Here, I can do as follows: A(i) = Rf('j1' , i); However. I will not be knowing j1 or j2 apriori. Instead, I will be only knowi...
by parag_patil
2 years ago
Forum: Syntax
Topic: Assigning value of a variable to another with programming flow control
Replies: 2
Views: 2307

Assigning value of a variable to another with programming flow control

Hello, I want to assign the existing values of variables to another variables using either of the following: loop statement for statement if-else statement Or while statement I do not want to use conditional ($) statements, because the number of elements is large sets tt /tt1*tt5/ t /t1*t10/ ; Varia...