Search found 203 matches

by Fred
1 year ago
Forum: Modeling
Topic: Alternative for max Funktion
Replies: 1
Views: 542

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
1 year ago
Forum: API
Topic: Solvers error when calling from MatLab
Replies: 7
Views: 2667

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
1 year ago
Forum: Modeling
Topic: scenario generation and reduction using SCENRED
Replies: 2
Views: 1024

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
1 year ago
Forum: Archive Google Group
Topic: Data exceeds range
Replies: 6
Views: 2172

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
1 year ago
Forum: Archive Google Group
Topic: Data exceeds range
Replies: 6
Views: 2172

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
1 year ago
Forum: Syntax
Topic: How to: create a sequenced (asterisked) set when the final value isnt known until runtime
Replies: 2
Views: 624

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
1 year ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 2930

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
1 year ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 2930

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
1 year ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 2930

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...
by Fred
1 year ago
Forum: Modeling
Topic: Iterative models/ Dynamic sets
Replies: 10
Views: 2930

Re: Iterative models/ Dynamic sets

Peter, You could introduce a dynamic subset of household and use that in the definition (not declaration!) of equations. set h(household) 'dynamic subset of household'; [...] variable x(t,household); [...] equation e(household); [...] e(h).. sum(t,x(t,h)) + ... =g= ...; Now if you set h(household) =...