Search found 162 matches

by Fred
4 months ago
Forum: Syntax
Topic: Speeding up constraint creation during compilation
Replies: 2
Views: 252

Re: Speeding up constraint creation during compilation

James, The crux is that you are making a lot of comparisons (in the range of card(h) x card(h)) in the equation body. Also, you are doing that for every z where the condition is completely independent from z. It is faster to precompute a mapping set outside the equation body. Basically you want for ...
by Fred
4 months ago
Forum: Modeling
Topic: Change Equation over time
Replies: 4
Views: 275

Re: Change Equation over time

You can just move the dollar condition into the equation body.

Code: Select all

eq(t).. I(t) =E= S(t) * (Y(t)$(ord(t)<=5) + AY(t)$(ord(t)>=6)) ;
I hope this helps!

Fred
by Fred
4 months ago
Forum: Solvers
Topic: the solver found integer solution
Replies: 11
Views: 697

Re: the solver found integer solution

Hi,

As Michael already suspected, the log states

Code: Select all

CPLEX Error  1001: Out of memory.
Fred
by Fred
4 months ago
Forum: Solvers
Topic: the solver found integer solution
Replies: 11
Views: 697

Re: the solver found integer solution

Hi, You are using a 13(!) year old version of GAMS and Cplex. I highly recommend to update to a more recent version (https://www.gams.com/download/). With the latest GAMS 27.2.0, Cplex reaches a smaller gap after seconds than what you get after hours. Still, the model seems to be challenging and you...
by Fred
4 months ago
Forum: Modeling
Topic: Change Equation over time
Replies: 4
Views: 275

Re: Change Equation over time

Hi, You can have two different equations, one for t<=5 and one for t>=6. Assuming that t is an ordered set (https://www.gams.com/latest/docs/UG_OrderedSets.html), this can be done as follows: equation eq1(t), eq2(t); [...] eq1(t)$(ord(t)<=5).. I(t) =E= S(t) * Y(t); eq2(t)$(ord(t)>=6).. I(t) =E= S(t)...
by Fred
4 months ago
Forum: Solvers
Topic: the solver found integer solution
Replies: 11
Views: 697

Re: the solver found integer solution

Hi, You wrote that you get MODEL STATUS 8 integer solution . Applying IIS makes no sense because it computes an irreducible infeasible set but your model is feasible. SOLVER STATUS 3 resource interrupt means that a time limit was reached before any other termination criterion was satisfied. This is ...
by Fred
4 months ago
Forum: Solvers
Topic: the solver found integer solution
Replies: 11
Views: 697

Re: the solver found integer solution

Hi, Sometimes it can take a long time to solve a difficult MIP. If you need the optimal solution you can set the relative optimality criterion optcr to zero and at the same time you should in crease the time limit reslim to give CPLEX more time to solve to optimality: https://www.gams.com/latest/doc...
by Fred
4 months ago
Forum: Modeling
Topic: Problem with loop in MINLP model.
Replies: 1
Views: 253

Re: Problem with loop in MINLP model.

Hi, Since you don't share with us how you set the starting point when you are not using a loop, there is no chance to tell you where the difference comes from. What you do in the loop looks strange. You set many variable levels and then you clear most of the variables before you do anything with the...
by Fred
4 months ago
Forum: Modeling
Topic: stochastic programming
Replies: 7
Views: 551

Re: stochastic programming

Where exactly are struggling? PV is a variable that is currently indexed with bus. If you want to index it over time as well, add a t to the index PV(bus,t) and make sure to adjust your code at all places where the variable occurs accordingly.

Regards,
Fred
by Fred
4 months ago
Forum: Modeling
Topic: Division by zero execution error
Replies: 1
Views: 206

Re: Division by zero execution error

Hi, you should set actual variable bounds like Theta11.lo = 10; Theta21.lo = 10; Theta12.lo = 10; Theta22.lo = 10; Theta13.lo = 10; Theta23.lo = 10; Theta14.lo = 10; Theta24.lo = 10; Theta15.lo = 10; Theta25.lo = 10; instead of trying to enforce bounds via constraints like e14.. Theta11=g=10; e15.. ...