Search found 602 matches

by bussieck
12 hours ago
Forum: Modeling
Topic: Lower bounds for objective variable (mimization problem)
Replies: 2
Views: 49

Re: Lower bounds for objective variable (mimization problem)

By adding bounds on the objective variable y (with y =e= f(x)) you turn your objective function f(x) into a true constraint and your objective consists of just min or max y instead of min or max f(x). This is mathematically the same, but in practice makes a big difference. The presolver (especially ...
by bussieck
1 week ago
Forum: Syntax
Topic: Trigonometric functions
Replies: 3
Views: 121

Re: Trigonometric functions

The trigx model has been added when GAMS added LGO. This is a highly non-convex model and hence a local solver like Conopt will produce local minima and will report "locally" infeasible when started from not so good starting points. So this is all expected behavior.

-Michael
by bussieck
1 week ago
Forum: Modeling
Topic: Create an shifting index gap
Replies: 2
Views: 172

Re: Create an shifting index gap

My colleague Alex Meeraus had an even better suggestion: set h / 1*8760 /, hh(h) / 1*4 /; variable g(h); equation e(h); e(h)$mod(ord(h),2).. sum(hh, g(h+hh.off)) =e= 0; He also pointed out that one as a modeler always has to think about the boundaries of the set. So what should happen for the last e...
by bussieck
1 week ago
Forum: Syntax
Topic: Trigonometric functions
Replies: 3
Views: 121

Re: Trigonometric functions

Javier, you are looking at the equation listing (https://www.gams.com/latest/docs/UG_GAM ... ionListing) section of the listing file. This indeed evaluates and displays the gradient of a variable in the equation at the input point.

-Michael
by bussieck
1 week ago
Forum: Syntax
Topic: Concatenate in GAMS
Replies: 2
Views: 187

Re: Concatenate in GAMS

Rather than looking at spreadsheet logic (vlookup) relational algebra like SQL from databases will give you a better understanding of how GAMS looks at data: * Declaration with artificial data set SiteIndexS /s1*s10/,SiteIndexP /p1*p10/, SiteINdexB /b1*b10/, Rot_Perc /r1*r10/, Ages /a1*a10/, Items /...
by bussieck
1 week ago
Forum: Modeling
Topic: Create an shifting index gap
Replies: 2
Views: 172

Re: Create an shifting index gap

Read about ordered set including lag and leeds at https://www.gams.com/latest/docs/UG_OrderedSets.html.

Code: Select all

set h / 1*8760 /, gh(h,h);
scalar i;
for (i=0 to 3,
  gh(h,h+i)$mod(ord(h),2)= yes;
)

alias (h,hh);
variable g(h);
equation e(h);
e(h)$mod(ord(h),2).. sum(gh(h,hh), g(hh)) =e= 0;
-Michael
by bussieck
1 week ago
Forum: Syntax
Topic: Refer to Special element of a set
Replies: 2
Views: 166

Re: Refer to Special element of a set

First make sure you get the order of i you expect by "display i"; Then you can get the first and last element like this

Code: Select all

set iFirst(i), iLast(i);
iFirst(i) = i.first;
iLast(i) = i.last;
display i,iFirst,iLast;
-Michael
by bussieck
2 weeks ago
Forum: API
Topic: Exporting data from MATLAB to GAMS
Replies: 5
Views: 193

Re: Exporting data from MATLAB to GAMS

Since you unload ps first the label order is fixed to 1,2,3,4... and hence the order in i (1;9;6;15) has no consequence to the order in the GDX file not in GAMS. So my second "solution" won't work (and you seem to work with an old GAMS system that does not have this capability anyway). You would hav...
by bussieck
2 weeks ago
Forum: API
Topic: Exporting data from MATLAB to GAMS
Replies: 5
Views: 193

Re: Exporting data from MATLAB to GAMS

There are different ways to deal with this ordering issue: 1) Have a two dimensional set instead of a one dimensional set to preserve the order: set i / 1*100/; alias (i,j); set order(i,j) / 1.10,2.5,3.2,4.9/; * iterate through i in user order: loop(order(i,j), put_utility 'log' / j.tl); 2) Rely on ...
by bussieck
2 weeks ago
Forum: Announcements
Topic: GAMS Distribution 35.2.0 (Minor Release)
Replies: 0
Views: 71

GAMS Distribution 35.2.0 (Minor Release)

Hi GAMS Users,

We started distributing GAMS Minor Release 35.2.0 on June 2, 2021.

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

Here are the release notes: https://www.gams.com/latest/docs/RN_35.html#RN_3520

Your GAMS Team
www.gams.com