Search found 108 matches

by cladelpino
1 year ago
Forum: Syntax
Topic: Getting error (rPower: FUNC DOMAIN: x**y, x < 0)
Replies: 4
Views: 1225

Re: Getting error (rPower: FUNC DOMAIN: x**y, x < 0)

First line of your linked support page: The power function power(x,y) is an integer power and thus the exponent y must be an integer. Looks to me like your exponent (0.3333) is not an integer.... This is the cause of your second error. The first error is caused by the "base" (x) not being positive. ...
by cladelpino
1 year ago
Forum: Syntax
Topic: local break-even point from mimized solutions
Replies: 1
Views: 526

Re: local break-even point from mimized solutions

You will need to store the value of any variable that you want to know later between solves..

parameter teVal,zVal,finalVal;

SOLVE uc USING minlp MINIMIZING z;

zVal=z.l;

SOLVE uc USING minlp MINIMIZING te;

teVal=te.l;

finalVal=min(zVal,teVal);
by cladelpino
1 year ago
Forum: Modeling
Topic: About New Constraint
Replies: 1
Views: 469

Re: About New Constraint

Hi Emine, perhaps you should keep this post in your original thread ? ( https://forum.gamsworld.org/viewtopic.php?f=9&t=10293 ). A general answer: If the problem is infeasible when you run it, you can generate a feasible solution by hand, fix the variables at this levels, and then find out which equ...
by cladelpino
1 year ago
Forum: Syntax
Topic: If Statement - Uncontrolled Set entered as a costant
Replies: 3
Views: 703

Re: If Statement - Uncontrolled Set entered as a costant

Hi, I understand that you want to fix the value of variable cg depending on the value of parameter pk. This code is one of the ways to accomplish this:

cg.fx(t)=47.898;
cg.fx(t)$(pk(t)=1)=36.367;

Best
Claudio
by cladelpino
1 year ago
Forum: Syntax
Topic: Inverting sets
Replies: 3
Views: 683

Re: Inverting sets

ehh... no ?
n^-1 should mean, that it is the inverted value.
What do you mean by "inverted" ? Why is inverted(1)=3 and inverted(3)=1 ?

Is it exchanging the last and first element ? For example for n= 4

x(1,i+1) = x(4,i)
x(2,i+1) = x(2,i)
x(3,i+1) = x(3,i)
x(4,i+1) = x(1,i)
by cladelpino
1 year ago
Forum: Syntax
Topic: Inverting sets
Replies: 3
Views: 683

Re: Inverting sets

What does n^-1 means in this :
x(n,i+1) = x(n^-1,i)
?

Are there always three members of n and the last and the first "exchange" each other sequentially ? ie:

x(1,1)=1
x(2,1)=2
x(3,1)=3
x(1,2)=3
x(2,2)=2
x(3,2)=1
x(1,3)=1
x(2,2)=2
x(3,3)=3

Are valid values ?
by cladelpino
1 year ago
Forum: Syntax
Topic: Constraint involving cumulative sums
Replies: 2
Views: 807

Re: Constraint involving cumulative sums

If I understand properly you may need another set:

alias(t,i);

y(i,j,k) =e= M - p(k) * ( sum(t$(ord(t)<ord(i)), y(t,j,k) ) - p(k) * ( sum(t$(ord(t)<ord(i)), y(j,t,k) )

Is this what you want ?

Best
Claudio
by cladelpino
1 year ago
Forum: Modeling
Topic: Connected Subgraph Generation
Replies: 1
Views: 692

Re: Connected Subgraph Generation

This problem of course admits a MIP formulation, but you cannot easily (of the top of my head) limit it to generate only one subgraph per run. Of course this may not be a problem for you (since you are trying to enumerate them all). Something along the lines of... set node nodes; set edge(node,node)...
by cladelpino
1 year ago
Forum: Modeling
Topic: hub network modelling
Replies: 1
Views: 838

Re: hub network modelling

Fix the variables at the values of a solution that should be feasible and with a better value of the objective function, then try to run the problem.
The infeasible constraints are blocking this solution.
by cladelpino
1 year ago
Forum: Syntax
Topic: How to set upper value instead of level value
Replies: 1
Views: 468

Re: How to set upper value instead of level value

:? do you mean

mindelay1(i,n,m) .. dee(i,n,m) - (v*y1(n,m)) =e= z(i,n) ;

?

Try to reformulate your question, at least for me its not understandable.