Search found 373 matches

by Fred
3 years ago
Forum: Syntax
Topic: read gdx through put_utilities gdxin in loop, but only if file exists
Replies: 2
Views: 2400

Re: read gdx through put_utilities gdxin in loop, but only if file exists

Hi, You could for example first create a list of the exitsing fuel type csv files. That list can be handled as subset of all the fuel types. Once you know that subset, you can loop over it to call csv2gdx and load the data from gdx only for the existing files, e.g. *create some dummy csv files for t...
by Fred
3 years ago
Forum: Syntax
Topic: Binary variables
Replies: 5
Views: 7977

Re: Binary variables

Hi, you should always check the model and solver status. S O L V E S U M M A R Y MODEL Rede OBJECTIVE cost TYPE MINLP DIRECTION MINIMIZE SOLVER SBB FROM LINE 122 **** SOLVER STATUS 4 Terminated By Solver **** MODEL STATUS 9 Intermediate Non-Integer **** OBJECTIVE VALUE 7.0711 Intermediate non-intege...
by Fred
3 years ago
Forum: Modeling
Topic: Different indexing for same variable
Replies: 7
Views: 4446

Re: Different indexing for same variable

For example as a part of an optimization problem I need to calculate the electricity generation cost from different types of plant by this formula : generation*fuel_price. But for different fuels the price varies so even though the variable generation's name is same but should be used with differen...
by Fred
3 years ago
Forum: Modeling
Topic: Different indexing for same variable
Replies: 7
Views: 4446

Re: Different indexing for same variable

Hi,

To cut it short, no.
Maybe you can provide a more elaborate example why you would want to do that. That might be helpful to suggest alternatives.

Best,
Fred
by Fred
3 years ago
Forum: Modeling
Topic: Modeling with the solution pool tool
Replies: 3
Views: 3592

Re: Modeling with the solution pool tool

Hi, if you want to incorporate the solution time in report parameter xcostx, you could do for example xcostX(scenario,'%1',solnpool,'TIME','','','') = EOGLSP.resusd; This gives the time the solver took for a solve statement. I don't think that you can access the information at what time of a solve a...
by Fred
3 years ago
Forum: Modeling
Topic: Modeling with the solution pool tool
Replies: 3
Views: 3592

Re: Modeling with the solution pool tool

Enrique, In your latest example there are 4 solve statements. You loop over 2 scenarios and for every scenario you solve the model twice. It seems that in readsoln.gms you are computing some sort of report parameter xcostX. You could give this parameter additional indices for scenario and 1st/2nd so...
by Fred
3 years ago
Forum: Solvers
Topic: Variable stopping criteria based on run time
Replies: 2
Views: 2996

Re: Variable stopping criteria based on run time

Hi, With CPLEX (the log tells me that you use CPLEX) you can update the solver option file. I attached an example based on model dice from the GAMS model library and the trigger file example from the support wiki. Cplex starts with optcr=0.01, after ~10 seconds it uses a cplex.op2 with optcr=0.1 and...
by Fred
3 years ago
Forum: Syntax
Topic: Random Numbers Beta
Replies: 1
Views: 1548

Re: Random Numbers Beta

Hi,

GAMS comes with a stochastic library that allows you draw random numbers from the beta distribution: https://www.gams.com/latest/docs/UG_Ext ... ticLibrary

I hope this helps!

Fred
by Fred
3 years ago
Forum: Tools
Topic: Load zero values to GAMS from GDX File
Replies: 6
Views: 6517

Re: Load zero values to GAMS from GDX File

If I run parameter VD0, VINTCD0, VFACD0, VF0, VINTCF0, VFACF0, TAXM0, VT0, TN, VQH0, QG, QINV, FSAVD0, FSAVF0, FSAVK0, SIGMA, GAMMA, SIGMAP, ITA; $call gdxxrw FRICTION.xlsx @FRICTION.txt $gdxin FRICTION.gdx $load VD0 VINTCD0 VFACD0 VF0 VINTCF0 VFACF0 TAXM0 VT0 TN VQH0 QG QINV FSAVD0 FSAVF0 FSAVK0 SI...
by Fred
3 years ago
Forum: Modeling
Topic: A "division by zero" in a line where no calculation happens
Replies: 7
Views: 23074

Re: A "division by zero" in a line where no calculation happens

Hi,

As I wrote in my previous post, the line numbers refer to the echo print in the lst file.
Looking up the lines and checking the data, there is obviously a division by zero.

Best,
Fred