## Search found 51 matches

- 44 minutes ago
- Forum: Tools
- Topic: MIPTRACE (objective value not in the exponential format)
- Replies:
**1** - Views:
**5**

### Re: MIPTRACE (objective value not in the exponential format)

nuno_r, Reading your post, I had a few questions: what solver? what version of GAMS? Who is nuno_r? I think your time would be better spent in scaling the model so the objective value is in a much smaller range (say, in the thousands instead of the trillions). The same goes for the constraints and v...

- 2 weeks ago
- Forum: Tools
- Topic: Generate an array of random numbers
- Replies:
**6** - Views:
**127**

### Re: Generate an array of random numbers

It seems we need to clarify what the original poster intended. If the intent was to draw a number of samples from a {0,1} distribution, then you would expect to get different numbers of 1s when using different random number seeds. But perhaps the intent was to just permute a given number of 1s. In t...

- 2 weeks ago
- Forum: Tools
- Topic: Generate an array of random numbers
- Replies:
**6** - Views:
**127**

### Re: Generate an array of random numbers

This does what you want. Setting the seed for the random number generator is not required, but it is useful to get different results for different runs. Set W /1*10/; Parameter Coef(W); scalar a / 0.7 /; * set the seed in some random way, based on the time execseed = gmillisec(jnow); coef(w) = [unif...

- 3 weeks ago
- Forum: Syntax
- Topic: Gams options
- Replies:
**1** - Views:
**93**

### Re: Gams options

Ildar, The log file you sent shows that the option file was read. You are using a fairly old version of GAMS/CPLEX from 2009. This version doesn't echo the non-default CPLEX options to the log, which would show you that the CPLEX library has accepted the options you have set. But the more recent ver...

- 1 month ago
- Forum: Modeling
- Topic: GAMS modeling of an conditional equation
- Replies:
**2** - Views:
**122**

### Re: GAMS modeling of an conditional equation

Hi, You have two strict inequalities there: one comparing parameters, the other comparing variables. The parameters can be compared this way, but not the variables. So you could do something like: set i / blah /; alias (i,j); parameter a(i); variables x(i); equation f(i,j); f(i,j)$[a(i) > a(j)] .. x...

- 1 month ago
- Forum: Modeling
- Topic: Running GAMS from MATLAB
- Replies:
**2** - Views:
**118**

### Re: Running GAMS from MATLAB

Masoud, I would advise you not to use the gams Mex-function. It's nice when it works, but if there is any error - and the error state is the normal state when you're developing a model or source code anywhere - it doesn't help you find and fix the error. In your example, where should you start looki...

- 1 month ago
- Forum: Modeling
- Topic: How to change GDX dimension limit?
- Replies:
**1** - Views:
**97**

### Re: How to change GDX dimension limit?

If you want to pass the number of buses as a string, you should not use GDX for that. Instead, just pass the string to gams as an argument. If you have this GAMS source in, say, power.gms: * check that NBUS is set: if not, terminate with error $if not set NBUS $abort 'NBUS must be set' set bi / bus1...

- 2 months ago
- Forum: Tools
- Topic: Select an element randomly from a multidimensional set
- Replies:
**3** - Views:
**155**

### 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...

- 3 months ago
- Forum: Solvers
- Topic: *** Failure calling solver: CONOPT4 (rc=1). What does it mean?
- Replies:
**5** - Views:
**363**

### 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...

- 3 months ago
- Forum: Solvers
- Topic: Various Answers
- Replies:
**4** - Views:
**301**

### 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...