Dear all,
I’m trying to solve a problem given in Paul Williams book “model building in mathematical programming” with GAMS
Here’s the solution with sMAGIC (www.maths.ed.ac.uk/ERGO/sMAGIC/) developed by Williams:http://personal.lse.ac.uk/williahp/mod_factory.htm
I have difficulties in forming the equations in GAMS, since I can’t use the syntax in sMAGIC
This is what I have so right now, and the optimal solution differs from Williams.
equations TARGET C1 C2 C3 C4 C5 C6; TARGET… Sum( (t,i), (dbx(i)xsold(t,i) - 0.5xhold(t,i)) ) =e= DB; C1(t,i)sameas(t,"1").. xprod(t,i) - xsold(t,i) - xhold(t,i) =e= 0; C2(t,i)(sameas(t,“2”) OR sameas(t,“3”) OR sameas(t,“4”) OR sameas(t,“5”) OR sameas(t,“6”))… xprod(t,i) - xsold(t,i) - xhold(t,i) + xhold(t-1,i) =e= 0; C3(m,t)… Sum(i, time(m,i)xprod(t,i)) =l= hours_availmach(m,t); C4(t,i)… xprod(t,i) =l= market(t,i); C5(t,i)$(sameas(t,“1”) OR sameas(t,“2”) OR sameas(t,“3”) OR sameas(t,“4”) OR sameas(t,“5”)) … xhold(t,i) =l= 100; C6(t,i)$sameas(t,“6”)… xhold(t,i) =e= 50;
Somehow I want to tell GAMS, to create Constraints of type C1 only for t=1, meaning for the first periode of the 6. Same applies to C2, were those kind of constraints should be created for t>1
C5 and C6 were created with a FOR-Loop and If condition in sMAGIC, but these constructs cant be used within equations…
I tried the $ symbol on the left hand side with some OR expressions… but no sucesss
Does anyone have a hint how to model Factorya and Factoryb in GAMS?
Thank you!
\
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.