Search found 10 matches

by petros.p
3 years ago
Forum: Syntax
Topic: Nested loop solves with dynamic sets: can I clear solutions between loops?
Replies: 3
Views: 3795

Re: Nested loop solves with dynamic sets: can I clear solutions between loops?

Hi Michael, Thanks a lot for your answer. Can I use the .savepoint facility inside a loop as well? Also, in case my original question was confusing: Before i decided to use nested loop solves, i manually set a value of my scalar "d" and pressed run (for example: d /0/, press run, then d /1...
by petros.p
3 years ago
Forum: Syntax
Topic: Nested loop solves with dynamic sets: can I clear solutions between loops?
Replies: 3
Views: 3795

Nested loop solves with dynamic sets: can I clear solutions between loops?

Hello. I have a discrete time problem for which I have some hourly variables and some daily variables that depend on dynamic sets which change in every iteration, depending on two sets: k and r. I made a code that has the following structure: sets i days /1*100/ t hours /1*1000/ ii(i) dynamic set of...
by petros.p
4 years ago
Forum: Syntax
Topic: Infeasibilities in loop solve using CPLEX
Replies: 3
Views: 8198

Re: Infeasibilities in loop solve using CPLEX

Hi Petros, Happy to read that you solved your problem. However, to avoid confusion, I would like to mention that that the mipstart option has little to do with your initial problem. You wrote that Cplex returns infeasible for your model. Instructing Cplex to use a starting point (which is what you ...
by petros.p
4 years ago
Forum: Syntax
Topic: Infeasibilities in loop solve using CPLEX
Replies: 3
Views: 8198

Re: Infeasibilities in loop solve using CPLEX

The answer to my problem:

In order for the solver to use initial solution, a solver options file must be created to set mipstart to 1.
by petros.p
4 years ago
Forum: Syntax
Topic: not equal tupels
Replies: 4
Views: 3183

Re: not equal tupels

Hi nikou,

Now I see, but I think that you could get the result you want if you just replace AND with OR.

Best,
Petros
by petros.p
4 years ago
Forum: Modeling
Topic: Error: rPower: FUNC DOMAIN: x**y,x=0,y<0
Replies: 2
Views: 11456

Re: Error: rPower: FUNC DOMAIN: x**y,x=0,y<0

Hi, What is your error exactly? From a first look I would say that ther should be a problem with your variables c(ii,a,t+(ord(a)-1)) and l(ii,a,t+(ord(a)-1)) beause they are defined in the sets (ii,a,t). So for example when t reaches its last element, the variable c(ii,a,t+(ord(a)-1)) should not exi...
by petros.p
4 years ago
Forum: Syntax
Topic: not equal tupels
Replies: 4
Views: 3183

Re: not equal tupels

Hi,

try this:

Code: Select all

eq(i,j,k,ii,jj,kk)$(ord(i) <> ord(ii) and ord(j) <> ord(jj) and ord(k) <> ord(kk))..
Best,
Petros
by petros.p
4 years ago
Forum: Modeling
Topic: Input the same parameter and variable
Replies: 4
Views: 15601

Re: Input the same parameter and variable

Hi, The way you should declare the set and parameter is: set i /i1*i100/; parameters x(i) /i99 1000, i100 1200/; But you can't have the same name for two different elements! If you want to have fixed values for the last two xariables you must use the following instead of the parameter: x.fx('i99') =...
by petros.p
4 years ago
Forum: Syntax
Topic: Please check my code. I have no idea what's wrong with it
Replies: 4
Views: 4822

Re: Please check my code. I have no idea what's wrong with it

Hi, Your problem is a mixed integer non linear program (MINLP). I used Baron to solve it and I think it is free for for a limited number of variables. Run the code below and tell me if it works: $TITLE Test Problem $OFFSYMXREF $OFFSYMLIST integer VARIABLES X1, X2 ; variable Z; EQUATIONS CON1, CON2, ...
by petros.p
4 years ago
Forum: Syntax
Topic: Infeasibilities in loop solve using CPLEX
Replies: 3
Views: 8198

Infeasibilities in loop solve using CPLEX

Hi everyone, I am trying to do an iterative solution process using the loop statement for a MILP. In each loop I solve my model for a subset of 24 hours and a subset of 15 days, which I declare this way: sets run Solve iterations /run1*run5/ t Time set /t1*t2437/ d Days set /d1*d100/ hour(t) Dynamic...