How to find the set elements that verify a condition
Posted: Fri Nov 03, 2017 4:12 pm
Dear All,
In my GAMS code, I have written two equations with which I am calculating the total costs of a energy system [variable TC on the domain j (fuel type) and i (technology)] and TCmin which allows me to determine the cheapest of the different configurations:
TotCost(i,j).. TC(i,j) =e=Eg(i)*C(i)+coi(i,'IC')+coj(j,'P')*V(i,j) ;
MinTotcost.. TCmin=e=smin((i,j),TC(i,j));
So far so good.
But to be totally happy with my code, I would like it to return not only the price of the cheapest configuration but also the details of that configuration: the corresponding set elements i and j .
As set elements are stored as string data type, I don't know how I possibly could get GAMS to give me a specific (i;j) subset as output data.
Any suggestion?
Thank you
In my GAMS code, I have written two equations with which I am calculating the total costs of a energy system [variable TC on the domain j (fuel type) and i (technology)] and TCmin which allows me to determine the cheapest of the different configurations:
TotCost(i,j).. TC(i,j) =e=Eg(i)*C(i)+coi(i,'IC')+coj(j,'P')*V(i,j) ;
MinTotcost.. TCmin=e=smin((i,j),TC(i,j));
So far so good.
But to be totally happy with my code, I would like it to return not only the price of the cheapest configuration but also the details of that configuration: the corresponding set elements i and j .
As set elements are stored as string data type, I don't know how I possibly could get GAMS to give me a specific (i;j) subset as output data.
Any suggestion?
Thank you