Search found 85 matches

by yanzhiping
1 month ago
Forum: Syntax
Topic: how to display the current value of a set
Replies: 1
Views: 77

how to display the current value of a set

I am trying to extract the current value of a set, but failed.

set Yr /1*14/;
scalar YrOrd;
loop(Yr,
YrOrd=ord(Yr);
display YrOrd, Yr(YrOrd);
);

Does anyone know what is the issue with the code above?

Thanks.
by yanzhiping
2 months ago
Forum: Syntax
Topic: equation control
Replies: 1
Views: 91

equation control

I have a conditional equation r1 depending on set q1, the equation r1 is controlled by the set b. if b is empty, then no r1 needed.
I used the following code, but it is not working.

Code: Select all

set q1(a,b,c,d,e)
equation r1(a,b,c,d,e)
r1(a,b,c,d,e)$b..
How may I control the equation correctly?

Thanks.
by yanzhiping
2 months ago
Forum: Modeling
Topic: how to get index of variables and constraints
Replies: 1
Views: 135

how to get index of variables and constraints

Excuse me, I have a question about the index of variables and constraints. If I have a set for device /device A, device B, device C/,.... there is a variable related to set (time, device), and a constraint related to device too. How may I know the index of variables and constraints related to only d...
by yanzhiping
2 months ago
Forum: API
Topic: model2tex
Replies: 1
Views: 161

model2tex

I am trying to run model2tex as following
https://www.gams.com/latest/docs/tools/ ... index.html
but it says no model found.
I wonder what is the input for model2tex, gdx,lst,ref or txt?
by yanzhiping
3 months ago
Forum: Modeling
Topic: how to generate lp file in a short time
Replies: 0
Views: 80

how to generate lp file in a short time

I want to get lp file from the GAMS model without solving it.
I tried convert optional file and terminate it after getting the lp file.
but it took 1 hour and 40 min to do that.
Is there any parameter which can speed up the process for LP file generation?

Thanks.
by yanzhiping
3 months ago
Forum: Modeling
Topic: mps in convert option
Replies: 0
Views: 70

mps in convert option

what is the difference between FixedMPS and CplexMPS?
https://www.gams.com/latest/docs/solver ... ED_OPTIONS
by yanzhiping
3 months ago
Forum: Modeling
Topic: how to generate lp file without solving it
Replies: 3
Views: 355

Re: how to generate lp file without solving it

where should I run those sed commands? in GAMS IDE or convert.opt?
by yanzhiping
3 months ago
Forum: Solvers
Topic: Option file for CPLEX solver
Replies: 4
Views: 221

Re: Option file for CPLEX solver

absolute gap is the upper bound for the distance between best integer and optimal solution is “best estimate” - “best integer”. https://support.gams.com/solver:what_is_optca_optcr instead of creating a cplex option file, try to do in GAMS, Option * relative termination tolerance for use in solving M...
by yanzhiping
3 months ago
Forum: Syntax
Topic: Having trouble with GAMS
Replies: 1
Views: 104

Re: Having trouble with GAMS

You can set solver to Cplex. Option mip =cplex; BCCf1.optfile = 1; BCCf2.optfile = 2; creat 2 option files cplex.opt/cplex.op2. cplex.opt is for BCCf1, and cplex.op2 is for BCCf2. In cplex.opt, writelp BCCf1.lp In cplex.op2, writelp BCCf2.lp after you get the lp files, test them only for a single it...
by yanzhiping
3 months ago
Forum: Solvers
Topic: Output Gurobi, Best possible
Replies: 2
Views: 133

Re: Output Gurobi, Best possible

You didnot get the real optimum when optcr is not 0. optcr is relative termination tolerance for use in solving MIP problems. even optcr is 0, you still get different optimal results because for the same optimization problem there could be multiple optimal solutions which will result in the same obj...