Search found 13 matches

by dasa
2 years ago
Forum: Syntax
Topic: Multiparametric programming
Replies: 1
Views: 2466

Multiparametric programming

Dear All,

is there anyone know if GAMS has syntax for Multiparametric programming?

Thanks
by dasa
3 years ago
Forum: Modeling
Topic: Problem is integer infeasible or unbounded
Replies: 3
Views: 5505

Re: Problem is integer infeasible or unbounded

Dear Bussieck,

Could you please give me an example for the term you mentioned " The relaxation method (I used Cplex option "feasopt 1") ". It would be very helpful for me if you could reproduce it in existing code above.

Thanks !!!
by dasa
3 years ago
Forum: Syntax
Topic: load data from excel with specific structure
Replies: 3
Views: 3945

Re: load data from excel with specific structure

p.xlsx Hi dasa, See code below, should be working with attached XLSX. Made some small changes, but most important is that every dimension needs its own column/row in Excel. Regards, GFA set m /1*3/; alias (m,n); parameter g(*,*,*) ; $onecho> p.txt Par=g rng=S1!B4:E7 rdim=2 cdim=1 $offecho $call GDX...
by dasa
3 years ago
Forum: Syntax
Topic: load data from excel with specific structure
Replies: 3
Views: 3945

load data from excel with specific structure

Dear all, Instead of writing table g (as you can see in the code) in gams, i wanna load it from excel. set m /1*3/; alias (m,n); Table g(m,n,*) a b 1.2 0.00375 0.00275 1.3 0.00375 0.0035 2.3 0.001875 0.0015 ; I have written some code. however, it doesn't work. Could someone modify or give me some id...
by dasa
3 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314079

Re: Loop for objective function

Hi The trick is to keep the loop index out of the model equations and assign values to parameters used in the equations within the loop: set t /1*5/ m /1*3/ alias(m,n); set conex(m,n) /1.2,1.3,2.3/; conex(m,n)$(conex(n,m))=1; ; parameter a(m) /1 2,2 3/; parameter b(m) /1 5,2 4.5/; variables Pm(t),z...
by dasa
3 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314079

Re: Loop for objective function

set t /1*5/ m /1*2/; parameter a(m) /1 2,2 3/; parameter b(m) /1 5,2 4.5/; variables Pm(t),z; parameter am, bm, resultsm, resultsmt; equation o1, c1, c2; o1.. z =e= am*sum(t,Pm(t))+bm; c1(t).. Pm(t) =l= 5; c2(t).. Pm(t) =g= 0; model gg /all/; loop(m, am = a(m); bm = b(m); solve gg using lp minimiza...
by dasa
3 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314079

Re: Loop for objective function

set t /1*5/ m /1*2/; parameter a(m) /1 2,2 3/; parameter b(m) /1 5,2 4.5/; variables Pm(t),z; parameter am, bm, resultsm, resultsmt; equation o1, c1, c2; o1.. z =e= am*sum(t,Pm(t))+bm; c1(t).. Pm(t) =l= 5; c2(t).. Pm(t) =g= 0; model gg /all/; loop(m, am = a(m); bm = b(m); solve gg using lp minimiza...
by dasa
3 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314079

Re: Loop for objective function

Hi It is not clear from your post what you intend to do. You assign the value of a variable to another variable before you solved the model (Pm(t) = P(m,t)) in a loop over m which also doesn't make sense. Pm(t) would get the value of the last m. CHeers Renger Hello, Thanks for your feedback. what i...
by dasa
3 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314079

Re: Loop for objective function

Hi You should rewrite the set j from your model and treat the variables and parameters independent of j. Here an example: set j /1*2/; parameter p(j) Parameter defined over j, pj Scalar to be used in the loop to replace p; p(j) = ord(j); variable OBJ,X; equation objective, eq1; objective.. OBJ =E= ...
by dasa
3 years ago
Forum: Modeling
Topic: Iterate existing “loop” until convergence
Replies: 1
Views: 3690

Iterate existing “loop” until convergence

Dear all, I have some problem related to iterate until converge. I understand that for 1 condition, it could be written as : .... Parameter converged; Converged=0; loop(iter$(not converged), statement … A= abs(UB-LB); converged$(A <= 0.01) = 1; ); However, what should I code if there are several con...