Search found 431 matches

by Renger
3 months ago
Forum: Syntax
Topic: how to use an expression as a subscript
Replies: 2
Views: 309

Re: how to use an expression as a subscript

]Hi Rina Note that set elements even if they are numbers, are not treated as numbers but like strings. Therefore, you can't do the typical operations like i+j. The trick is to use either the ord operator (gives you the position of the set element as integer) or the value of the set element by adding...
by Renger
3 months ago
Forum: Modeling
Topic: neative values problem
Replies: 2
Views: 310

Re: neative values problem

Hi THis has to do how Gams treats equations: it puts all stuff on the LHS setting it equal to zero. If you have your variable on the right-hand side, it will have a minus sign in front of it. Have a look at this dummy model where I put the variable X on the left and right-hand side in the same equat...
by Renger
3 months ago
Forum: Syntax
Topic: MIP modelling
Replies: 1
Views: 293

Re: MIP modelling

Hi
If you want help, you have to more speficic (please read the guidelines of this forum on how to).
Cheers
Renger
by Renger
4 months ago
Forum: Syntax
Topic: Size of a Table
Replies: 2
Views: 312

Re: Size of a Table

Hi No, there is no command for that, however, you can find it out using some code: If the table is defined over known sets, you can do something like this: set i /i1*i4/, j /j1*j5/; parameter a(i,j); a(i,j) = uniform(0,1); parameter dimension; dimension("a","row") = sum(i,1); dimension("a","col") = ...
by Renger
4 months ago
Forum: Syntax
Topic: Problem with the OF when replacing =g= with =e=
Replies: 7
Views: 529

Re: Problem with the OF when replacing =g= with =e=

Hi Hard to say: your model is infeasible so it might have no solution with the specifications you give. The constraint 7 seems to be a problem. You should btw always check the model status in the solve summary: S O L V E S U M M A R Y MODEL loadflow OBJECTIVE OF TYPE LP DIRECTION MINIMIZE SOLVER CPL...
by Renger
4 months ago
Forum: Syntax
Topic: Problem with the OF when replacing =g= with =e=
Replies: 7
Views: 529

Re: Problem with the OF when replacing =g= with =e=

Hi If I run it with CPLEX, I get an infeasible model: Iteration log . . . Iteration: 1 Infeasibility = 16.858406 LP status(3): infeasible Cplex Time: 0.00sec (det. 0.02 ticks) Model has been proven infeasible. --- Restarting execution --- Reading solution for model loadflow *** Status: Normal comple...
by Renger
4 months ago
Forum: Syntax
Topic: Problem with the OF when replacing =g= with =e=
Replies: 7
Views: 529

Re: Problem with the OF when replacing =g= with =e=

Hi If I run your model with the equal sign, I get an infeasible solution as the constraint 7 is infeasible. Taking this constraint out leads to an optimal solution. Set =E= to =G= doesn't change the problem of infeasibility. So I don't know if you are running the same code. If you post code, put it ...
by Renger
4 months ago
Forum: Syntax
Topic: How to add up negative and positive numbers?
Replies: 3
Views: 304

Re: How to add up negative and positive numbers?

Hi
Search in this forum for "absolute value" and you will find 8 pages with hits (not all relevant).
Cheers
Renger
by Renger
4 months ago
Forum: Syntax
Topic: Least Squares Notation
Replies: 1
Views: 190

Re: Least Squares Notation

Hi
The 'x' and 'y' are just the column headings for a table with the x and y values.

Code: Select all

set o Observations /o1*o12/;

table data(o,*) Table with data
      	x     	y
ob1 	1     	2
ob2 	2     	3.9
...
Your example looks fine.
Cheers
Renger