Hello Google Gamsworld,
I’m a beginner at Gams and linear optimization and I have a question:
I have got a positive variable var1(t). For every element of t the variable is restricted for example: var1(t=1)=10.
If I have an equation like
equation(a,t) … var2(a) (7,1). I want to solve this equation for all pairs of t and a that don’t cause an error or rather: I just want to include the pairs of elements of the two sets that are errorfree in all equations… Is that possible in Gams?
Thank you in advance
Gachtanna
–
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.
Hi Gachtanna,
Of course this is possible, and there are probably several ways to achieve this, depending on how you define the bounds on your variables.
You might just try :
equation(a,t) $(var2.lo(a) le var1.up(t)) … var2(a) =L= var1(t) ;
which will generate the equation only if the respective bounds on your variables allow you to find a feasible solution.
Just have a look in the manual at the “conditional equations” section, you should find everything you need in there.
cheers
dax
Le jeudi 22 octobre 2015 08:45:46 UTC+2, Kachtanna a écrit :
Hello Google Gamsworld,
I’m a beginner at Gams and linear optimization and I have a question:
I have got a positive variable var1(t). For every element of t the variable is restricted for example: var1(t=1)=10.
If I have an equation like
equation(a,t) … var2(a) (7,1). I want to solve this equation for all pairs of t and a that don’t cause an error or rather: I just want to include the pairs of elements of the two sets that are errorfree in all equations… Is that possible in Gams?
Thank you in advance
Gachtanna
–
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.
Hi dax,
thank you for your response!
I didn’t post my own model and tried to imagine a similar problem but that didn’t work: In fact it’s not so easy like in my example.
I don’t want to post my model here, so I will make up another similar story, I hope it will represent my true situation: Imagine you have a factory of steel and you want to maximize the profit (including taxes) with your Gams Model.
You have to pay taxes on your profit (profit without taxes), the tax rate changes depending on the profit. Therefore I invented a set “a” that represents the tresholds. Variable var1(a) represents the taxes you have to pay normally. But if you have a production of less than 99 tons of steel, you have to pay no turnover tax of all, therefore I invented the set t that represents that treshold and a Parameter that is 1 or 0 if production its above or below that treshold. The tax is therefore parameter(t)*var1(a).
Assume your last treshold for tax is a profit of 9999999999999999999 €.You can’t produce less than 99 tons of steel when you have a porfit of more than 9999999999999999999 €. But you don’t know from first glance like in my first example above how the correlation between the two is because there are much factors.
At the end of the model I use a loop over a and t and I have the solve statement in the loop, so that I will have results for all pairs of a and t, but for some pairs the model is not feasible. So therefore it would be great if it was possible to make some statement before the loop, so the loop just includes the pairs of elements of the two sets that are feasible in all equations.
Thank you very much in advance
Kachtanna
\
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.