Search found 26 matches

by dirkse
13 hours ago
Forum: Modeling
Topic: How to compute endogenous cost expressions in GAMs
Replies: 3
Views: 71

Re: How to compute endogenous cost expressions in GAMs

Hi, GAMS ships with stolib, an extrinsic function library full of functions relevant to probability and statistics. For example, the CDF and inverse-CDF functions for many distributions (including the normal distribution) are contained in this library. Details and examples are in the docs: https://w...
by dirkse
1 day ago
Forum: Modeling
Topic: GAMS does not read my code
Replies: 3
Views: 27

Re: GAMS does not read my code

Your problem is similar to that of accessing all elements of a parameter A(i,i). This link explains how an alias (or in your case, two aliases: one for i, another for j) will solve the problem:
by dirkse
1 day ago
Forum: Syntax
Topic: Can GAMS define my own function?
Replies: 2
Views: 27

Re: Can GAMS define my own function?

Gabriel, GAMS does not support functions of the sort you describe. Instead, you can use the include facility to include a file containing the GAMS source at both spots. A little reminder though: you cannot declare things inside an if statement. It is fine to make assignments and solve models inside ...
by dirkse
4 days ago
Forum: Syntax
Topic: Inner Assignment of Parameter
Replies: 1
Views: 59

Re: Inner Assignment of Parameter

Gabriel, It seems you are trying to do Matlab programming in the GAMS language. That is possible, but as you have discovered, it's "wierd" and "uncomfortable", to use your words. I suggest you do things "the GAMS way". That means many things, but in this case it implies using the relational data mod...
by dirkse
2 months ago
Forum: Solvers
Topic: Can GAMS run two models at the same time?
Replies: 2
Views: 132

Re: Can GAMS run two models at the same time?

The answer depends on how you run the models. If you have two separate GAMS jobs, then the solvers run in separate and independent processes. The only way they can interfere is if they use the same files. For example, if you have two GAMS jobs running "gams trnsport" in the same directory you could ...
by dirkse
2 months ago
Forum: Solvers
Topic: How to set the GAMS option optCR if I don't know whether the problem satisfies strong duality?
Replies: 2
Views: 150

Re: How to set the GAMS option optCR if I don't know whether the problem satisfies strong duality?

You are confusing the duality gap with the optimality gap. These are not at all the same, although with some mental gymnastics I am sure you could make connections between the two. The duality gap has to do with the difference between the objectives in the primal and dual forms of a model. For examp...
by dirkse
2 months ago
Forum: API
Topic: Can GAMS connect to MATLAB?
Replies: 1
Views: 109

Re: Can GAMS connect to MATLAB?

In general, it is not possible to hook a solver coded in Matlab to GAMS in the same way you'd connect a solver implemented in C or C++. Depending on the model type, you could dump the model instance in one of several generic formats (e.g. MPS, LP-file) using GAMS/CONVERT or some other scheme (many e...
by dirkse
4 months ago
Forum: Syntax
Topic: Single Element of a Set of a Parameter in a For Statement
Replies: 1
Views: 272

Re: Single Element of a Set of a Parameter in a For Statement

A common way to implement what you ask about - solves for different scenarios or data values - is to set up a loop over the scenarios you want to consider. In the loop, assign scenario values to the parameters used in the model, solve, and extract results to a parameter indexed by the scenario set. ...
by dirkse
4 months ago
Forum: API
Topic: metadata - keeping track of parameter descriptions
Replies: 2
Views: 417

Re: metadata - keeping track of parameter descriptions

Andy,

This metadata is called the explanatory text, or just text. It is part of the GamsSymbol class, accessible as a property called text.

https://www.gams.com/latest/docs/apis/p ... ymbol.html

-Steve