Search found 1042 matches

by bussieck
1 day ago
Forum: Modeling
Topic: How can I random the consecutive number?
Replies: 4
Views: 299

Re: How can I random the consecutive number?

You can just check if no 1-sequence starts in r1 or ends in r10. If that's the case you just take first column or last column to be the start/end. -Michael set i /r1*r10/, j /c1*c6/, iter /1*3/; parameter rowstart, cnt, randval(i,j) Random values, randvalloop(iter, i,j) Store the random values; $set...
by bussieck
1 day ago
Forum: Tools
Topic: GDX MPS2GMS
Replies: 2
Views: 121

Re: GDX MPS2GMS

MPS2GMS reads an MPS file and provides you with a pretty generic GMS file and the data (coefficients, bounds, rhs) in the GDX data. Hence, you can solve your MPS file abc.mps by running "mps2gms abc.mps" and afterwards "gams abc.gms".


Good luck,
-Michael
by bussieck
2 days ago
Forum: Syntax
Topic: BESS modeling Error 148 and 258 in obj function.
Replies: 1
Views: 169

Re: BESS modeling Error 148 and 258 in obj function.

Hi, First the is a very nice formatting control to copy and paste code. Please use that. On the particular question. You have an objective variable obj(h,z), so for every h and z there is a variable and you ask the solver to optimize it. A solver can only optimize a single variable not h times z man...
by bussieck
2 days ago
Forum: Modeling
Topic: How can I random the consecutive number?
Replies: 4
Views: 299

Re: How can I random the consecutive number?

Here is some GAMS code of what I think you want to accomplish. Not sure what the iter was about, but I create now iter many of such tables with random starting position of 4 consecutive ones in the columns: set i /r1*r10/, j /c1*c6/, iter /1*3/; parameter rowstart, cnt, randval(i,j) Random values, r...
by bussieck
5 days ago
Forum: Syntax
Topic: Connecting ordered sets
Replies: 2
Views: 838

Re: Connecting ordered sets

If you need the previous "period" in your model, you should think in terms single dimension time periods rather than (y,d,t) tuples and model with this. If you need occasionally access to data of a particular year, date, hour of a period you can do this by mapping from the period to the y,...
by bussieck
2 weeks ago
Forum: Modeling
Topic: Nonlinear Programming/ Steiner Weber Modell with barriers
Replies: 1
Views: 789

Re: Nonlinear Programming/ Steiner Weber Modell with barriers

This is a straight forward text book optimization problem. Get the math straight and GAMS will follow. If you have detailed questions on how to to particular formulations or tasks in GAMS you will find answers here. Getting the math right is the whole fun and you should not shortcut this experience....
by bussieck
2 weeks ago
Forum: Modeling
Topic: Erorr 149
Replies: 1
Views: 485

Re: Erorr 149

What i should GAMS use for the s(i)? The control of i stops with the sum. The equation is controlled over j.

-Michael
by bussieck
2 weeks ago
Forum: Syntax
Topic: A problem with parentheses
Replies: 3
Views: 982

Re: A problem with parentheses

Not sure what editor you used, but GAMS does not like your "≤" nor the "∗". These are unicode characters not part of the GAMS language, hence the compiler gets confused. Just use the regular ASCII characters/character sequence "<=" and "*".

-Michael
by bussieck
3 weeks ago
Forum: Syntax
Topic: $ifThen set X or Y
Replies: 2
Views: 677

Re: $ifThen set X or Y

No, the "$if set" only works on a single compile time variable name, not an expression. You can work around this by having a parallel set of numerical compile time variables and then use $ifThenE: $set xset 0 $if set x $set xset 1 $set yset 0 $if set y $set yset 1 $log %xset%%yset% $ifThen...
by bussieck
2 months ago
Forum: Announcements
Topic: GAMS Distribution 46.1.0 (Major Release)
Replies: 0
Views: 1292

GAMS Distribution 46.1.0 (Major Release)

Hi GAMS Users,

We started distributing GAMS Release 46.1.0 on February 21, 2024.

You can download the software from https://www.gams.com/download/

Here are the release notes: https://www.gams.com/latest/docs/RN_46.html

Your GAMS Team
www.gams.com