Search found 54 matches

by Fred
2 weeks ago
Forum: Syntax
Topic: Using 2 dimensional sets
Replies: 2
Views: 74

Re: Using 2 dimensional sets

Hi, To me it seems that the problem isn't caused by variable v or its domain but by the fact that you use the mod function on sets which isn't possible. I also notice that f and r are not under control in the sum. Maybe you want something like e7(d,gb).. k(d,gb)=e= sum(fr(f,r),(1-min(abs(mod(d.val,f...
by Fred
2 weeks ago
Forum: Modeling
Topic: Alternative for max Funktion
Replies: 1
Views: 88

Re: Alternative for max Funktion

Schroesa1, In the GAMS model lbrary, there is a model called nbsimple (https://www.gams.com/latest/emplib_ml/libhtml/emplib_nbsimple.html?search=nbsimple) that implements a simple version of the newsvendor (aka newsboy) problem with the help of the EMP Framework (https://www.gams.com/latest/docs/UG_...
by Fred
2 weeks ago
Forum: API
Topic: Solvers error when calling from MatLab
Replies: 7
Views: 325

Re: Solvers error when calling from MatLab

Hi, Now that you figured out that there was a typo, it seems like a natural next step to use "option subsystems;" without a typo and have a look at the output this option produces in the lst file. Maybe you also can share the lst file here, so other users can have a look at it and may be able to hel...
by Fred
2 weeks ago
Forum: Modeling
Topic: scenario generation and reduction using SCENRED
Replies: 2
Views: 97

Re: scenario generation and reduction using SCENRED

Hi Shela, If you search the GAMS Model libraries (https://www.gams.com/latest/docs/searchmodlibs.html) for keywords like 'Scenred', 'tree construction, etc., you will find several examples, such as https://www.gams.com/latest/testlib_ml/libhtml/testlib_scnred01.html https://www.gams.com/latest/gamsl...
by Fred
3 weeks ago
Forum: Archive Google Group
Topic: Data exceeds range
Replies: 6
Views: 345

Re: Data exceeds range

By default, for a one dimensional variable, GDXXRW will set cdim=1 and rdim=0, which means that you would get 17518 columns which is beyond Excels limit of at most 16,384 columns. You can change the format of how the variable is exported to Excel by setting redim and cdim manually. Try for example g...
by Fred
3 weeks ago
Forum: Archive Google Group
Topic: Data exceeds range
Replies: 6
Views: 345

Re: Data exceeds range

Hi,

Can you share some more details? How do you try to export the data (what is the exact GDXXRW call) and what is the full error message?
In order to let others reproduce the issue, it may also be helpful if you could share the gdx file.

Best,
Fred
by Fred
3 weeks ago
Forum: Syntax
Topic: How to: create a sequenced (asterisked) set when the final value isnt known until runtime
Replies: 2
Views: 98

Re: How to: create a sequenced (asterisked) set when the final value isnt known until runtime

Andy, I doubt that this works as you expect. Sets are declared at compilation time. The_put_utility statement is executed at execution time. Hence, the file expandedTrdBlk.inc is also created at execution time and does not exist at compile time when you do the $include "expandedTrdBlk.inc"; Maybe th...
by Fred
3 weeks ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 295

Re: Iterative models/ Dynamic sets

Peter, If you don't share your model please don't expect others to write code for you that works with your model out of the box! Please find further comments below. Thanks Fred for your answer, there are still a few things that I do not understand. $eval tSlices ceil(card(tt)/288) why do we need a C...
by Fred
3 weeks ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 295

Re: Iterative models/ Dynamic sets

Peter, Just pasting code that you don't understand is probably not a good idea. In order to provide target-oriented help, it would be good to know what part of the code you do not understand. I assumed that you have set of all timeslots. In my example this was tt. I dont know how many timeslots you ...
by Fred
3 weeks ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 295

Re: Iterative models/ Dynamic sets

Peter, Yes, you can use nested loops to implement that. The following example creates a set of time slices and maps the slices to the original timeslots (not sure how many you have in total). Then you can basically use the same logic with dynamic subsets for the timeslots in your equations as illust...