Search found 84 matches

by dirkse
8 months ago
Forum: Tools
Topic: Select an element randomly from a multidimensional set
Replies: 3
Views: 389

Re: Select an element randomly from a multidimensional set

I like Clemens' Python approach. But if that's not your style, you can construct the function you wanted - what you thought ord() would give you - in a parameter, and use that: sets i / i1, i2 / j / j1 * j3 / ij(i,j) / i1.(j1,j2), i2.(j2,j3) / rnd(i,j) ; scalars n, r; parameter pos(i,j) 'position in...
by dirkse
9 months ago
Forum: Solvers
Topic: *** Failure calling solver: CONOPT4 (rc=1). What does it mean?
Replies: 6
Views: 819

Re: *** Failure calling solver: CONOPT4 (rc=1). What does it means?

Yehuda, Precisely speaking, there is really no such thing as buying an updated version. The GAMS licensing model is based primarily on time. For example, new licenses come with 12 months of Maintenance & Support (M&S). During this 12 months (and perhaps a bit longer) you can be assured that your lic...
by dirkse
9 months ago
Forum: Solvers
Topic: Various Answers
Replies: 4
Views: 560

Re: Various Answers

There are several possible explanations for this behavior, for example: 1. Your model could have multiple optimal solutions. Even when using the same software, you cannot expect always the same answers on different machines, because solvers use automatic CPU dispatch to run code optimized for the ch...
by dirkse
9 months ago
Forum: Modeling
Topic: Emp: 2 shared variables in 1 equation
Replies: 2
Views: 381

Re: Emp: 2 shared variables in 1 equation

Yiwan, I looked at your question for a bit of time but there's not enough detail to give a proper response. You don't show any actual GAMS code, so I have to assume a lot. Too much, actually, to give a good reply. If you created a minimal example of working code that illustrates your difficulty you'...
by dirkse
9 months ago
Forum: Tools
Topic: Issue with GDXRRW file
Replies: 1
Views: 903

Re: Issue with GDXRRW file

Have you checked if the XLSX file is open in Excel when you try to read it with gdxxrw? If so, have you tried running this when the file is closed?
by dirkse
9 months ago
Forum: Syntax
Topic: Appending to a parameter
Replies: 2
Views: 1469

Re: Appending to a parameter

David, To solve your problem it's helpful to get a little bit below the surface and note that gdxxrw does not communicate directly with GAMS - instead, it moves data between Excel and a GDX file. There's plenty to say about GDX, but I can't do it better than in the docs: https://www.gams.com/latest/...
by dirkse
9 months ago
Forum: Archive Google Group
Topic: GDXMRW not working at all
Replies: 5
Views: 1342

Re: GDXMRW not working at all

You should not use the gams() Mex-function. It works, but if there is any error in your model, or your data, or your connection, it gives very little help or feedback to fix your error. Instead, you should call GAMS via Matlab's system() call. This will allow you to address any failures outside the ...
by dirkse
11 months ago
Forum: Modeling
Topic: Question about Simpson's integration.
Replies: 2
Views: 380

Re: Question about Simpson's integration.

If you find that using Simpson's rule is throwing you off, then by all means implement a solution using the trapezoid rule. That will give you something, and you can move from that to Simpson's quite easily, I believe. It seems to me the real difficulty is independent of which integration method is ...
by dirkse
1 year ago
Forum: Tools
Topic: Problem with round-tripping variables using rgdx / wgdx
Replies: 10
Views: 2424

Re: Problem with round-tripping variables using rgdx / wgdx

Hi, I should have mentioned a couple things in my last post on this. First, you cannot do a compressed read for variables or equations. For parameters, we squeeze out index positions that don't have any data, i.e.that are all zero. But for some fields of a variable, the default is not zero. For exam...
by dirkse
1 year ago
Forum: Tools
Topic: Problem with round-tripping variables using rgdx / wgdx
Replies: 10
Views: 2424

Re: Problem with round-tripping variables using rgdx / wgdx

Alois, I can appreciate the struggle you have been engaged in with R, gdxrrw, and GDX files. Please find below some observations about the topic that I hope you find helpful. I will also try to include some attachments of some GAMS and R source that illustrates a way forward for you. 1. GDX data is ...