Search found 295 matches

by abhosekar
2 years ago
Forum: GAMS-FAQ
Topic: GDXMRW: How can I adjust the startup Matlab Path on Linux or Mac?
Replies: 0
Views: 7847

GDXMRW: How can I adjust the startup Matlab Path on Linux or Mac?

Note: Starting with GAMS version 38, GAMSTransfer Matlab is the preferred way to transfer data between Matlab and GAMS. For GDXMRW, I run Matlab on a machine where I have no root privileges so updating the system-wide ''pathdef.m'' is not possible. However, Matlab checks the MATLABPATH environment v...
by abhosekar
2 years ago
Forum: Modeling
Topic: Conditions in constraints
Replies: 2
Views: 3026

Re: Conditions in constraints

You are missing ord() operator : https://www.gams.com/latest/docs/UG_OrderedSets.html#UG_OrderedSets_TheOrdOperator ctFreez(p,t,a)$(ord(t)<=2) ..q(p,t,a)=e= q(p,t,a-1) This should work. Same for second question. sum(dt $( (ord(dt) > ord(t)) and (ord(dt) <= ord(t) + lambda)) , ....) - Atharv
by abhosekar
2 years ago
Forum: Syntax
Topic: Net, Loading and unloading of resources
Replies: 7
Views: 4453

Re: Net, Loading and unloading of resources

There are many many fundamentally wrong things in this piece of code. Brings me back to my initial comment "what do you mean by "positive value of NVS equal to "LVS"" if you already have a value, do you want to reset it? Do you already have values for NVS?" Parameter LV...
by abhosekar
2 years ago
Forum: Syntax
Topic: Uncontrolled set entered as constant
Replies: 2
Views: 2696

Re: Uncontrolled set entered as constant

Equation
Capacity(n) 'maximum mining capacity';
Capacity(n).. s(n) =l= Capacity1(n);

Check this for more details.https://www.gams.com/latest/docs/UG_Fix ... ors_ErrorG
-Atharv
by abhosekar
2 years ago
Forum: Syntax
Topic: Net, Loading and unloading of resources
Replies: 7
Views: 4453

Re: Net, Loading and unloading of resources

After solve, variables have much more information than just the solution. They have (.l, .lo, .up, .scale, .m). Please take a look at variable attributes for more details: https://www.gams.com/latest/docs/UG_Variables.html#UG_Variables_VariableAttributes When you just write variablename, GAMS does n...
by abhosekar
2 years ago
Forum: Syntax
Topic: Empty parameter in gdx after unload
Replies: 1
Views: 1608

Re: Empty parameter in gdx after unload

Sujit,
can you attach a minimal example reproducing this issue?

Code: Select all

set 
i /i1*i5/
j /j1*j5/
;

parameter
p(i);
p(i) =20;

execute_unload 'parameterunload.gdx';
Does this work for you? Do you see parameter p in the gdx resulting gdx file after running the above program?

- Atharv
by abhosekar
2 years ago
Forum: Syntax
Topic: Net, Loading and unloading of resources
Replies: 7
Views: 4453

Re: Net, Loading and unloading of resources

Looks like all these are parameters. You don't need =e= type equations for this. This are simply assignments like you do in a normal program. what do you mean by "positive value of NVS equal to "LVS"" if you already have a value, do you want to reset it? Do you already have value...
by abhosekar
2 years ago
Forum: Syntax
Topic: values of sets in binary variable
Replies: 6
Views: 9959

Re: values of sets in binary variable

Hi, I suggest using .val only if set elements are numbers. So now in your code, I see set t/t0*t100/ and you are using t.val. This does not make sense. Please keep your set t to be /0*100/ if you want to use .val. Besides, the errors you see now are just the repeat of your previous errors. The varia...
by abhosekar
2 years ago
Forum: Syntax
Topic: values of sets in binary variable
Replies: 6
Views: 9959

Re: values of sets in binary variable

Fixed the typo. It should be x(i,j,t).
- atharv
by abhosekar
2 years ago
Forum: Syntax
Topic: values of sets in binary variable
Replies: 6
Views: 9959

Re: values of sets in binary variable

I see the problem. You are trying to access variables by parameters. x(v(m)) makes no sense to GAMS as v(m) is not even set. Just because v(m) is 1, does not mean it is 1 that is contained in the set i. One easy way to see why this is flawed is following: If you rename the set i /1*10/ to be i /i1*i...