Search found 1042 matches

by bussieck
1 year ago
Forum: Modeling
Topic: *** Error at line 171: division by zero (0)
Replies: 2
Views: 1388

Re: *** Error at line 171: division by zero (0)

The listing files helps you. The error is "**** Exec Error at line 171: division by zero (0)". Line 171 in the lst file is "171 C(t)=[Dreq(t)]+[[sum(i,(lambda(i)/theta(i)))]/[sum(i,(1/theta(i)))]];". Here you sum over all i and eventually divide by theta(i). If you look at your d...
by bussieck
1 year ago
Forum: Modeling
Topic: Multiplication of two subset of variables variables
Replies: 2
Views: 1252

Re: Multiplication of two subset of variables variables

Hi, you need to establish a map that maps the first element of a to the first element of b, etc. If you have a map ab like this the algebra is simple: obj.. cost =e= sum(ab(a,b), x(a)*x(b) ). So question is how do you get such a map. There are many ways to do that in GAMS. There is some power syntax...
by bussieck
1 year ago
Forum: Modeling
Topic: Two dependent variables in an additional equation
Replies: 2
Views: 1145

Re: Two dependent variables in an additional equation

Almost there. You need to fix the variable price in the first period to the externally given price. Moreover, you need at add an index t to your equation, because you want to have equality for all (but the first) t. The condition to skip the first t also goes on the equation: Equation eq1(t); eq1(t)...
by bussieck
1 year ago
Forum: Syntax
Topic: Subset of multiple subsets
Replies: 4
Views: 7019

Re: Subset of multiple subsets

Martin, This won't work with referential integrity/domain checking. The domains build a tree: * | abc / \ ab ac and you either put a under ab or ac but not under both. You can avoid GAMS domain checking by doing controlled a $on/offUni (see https://www.gams.com/40/docs/UG_DollarControlOptions.html#D...
by bussieck
1 year ago
Forum: Modeling
Topic: Equality constraint not enforced
Replies: 4
Views: 6187

Re: Equality constraint not enforced

Zack, The relative infeasibiliy of the constraint you show in this thread is 1e-4 and you ask for 1e-6 (in the simplex algorithm). Since Cplex' B&C uses the simplex algorithm (by default) in the nodes, we should get this required accuracy. Nevertheless, the log indicates, that a heuristic found ...
by bussieck
1 year ago
Forum: Solvers
Topic: Branching Variable in CPLEX
Replies: 5
Views: 7818

Re: Branching Variable in CPLEX

The callback programs of the BCH Facility (see https://www.gams.com/latest/docs/UG_SolverUsage.html#ADVANCED_USAGE_BCHFacility) get the fractional and integral solution of a node as GDX input files. You need to convince GAMS/Cplex with options to call these programs all the time and save away the in...
by bussieck
1 year ago
Forum: Syntax
Topic: Optimize reservoir hedging rules
Replies: 9
Views: 5579

Re: Optimize reservoir hedging rules

Your MINLP is actually a MIQCP and hence you can use Gurobi. With Gurobi's IIS you get: S O L V E S U M M A R Y MODEL YNHWZD OBJECTIVE obj TYPE MIQCP DIRECTION MINIMIZE SOLVER GUROBI FROM LINE 592 **** SOLVER STATUS 1 Normal Completion **** MODEL STATUS 19 Infeasible - No Solution **** OBJECTIVE VAL...
by bussieck
1 year ago
Forum: Archive Google Group
Topic: Error in gdxrrw package
Replies: 4
Views: 8733

Re: Error in gdxrrw package

Somehow you GAMS and gdxxrw do not match. The GDX call in question was introduced in GAMS 33, see https://www.gams.com/39/docs/RN_33.html ... 3310_XPAPI. So your gdxrrw must be post GAMS 33 while you regular GAMS version is 31.

-Michael
by bussieck
1 year ago
Forum: Modeling
Topic: index set creation
Replies: 1
Views: 2870

Re: index set creation

Make set "order" parallel to set O:

Code: Select all

set order, O, oOmap(order<, O<) / 1.Bananas, 2.Apples, 3.Oranges /;
-Michael
by bussieck
1 year ago
Forum: Solvers
Topic: Discrepancy solution reports solver Gurobi vs. CPLEX
Replies: 3
Views: 6016

Re: Discrepancy solution reports solver Gurobi vs. CPLEX

What optCR tolerance did you set? From the Gurobi log it seems that you have something >0 since Gurobi did not close the gap entirely. The "best possible" is a bound, not a solution and it follows directly from the branch-and-bound algorithm which you find described in any decent text book...