Good morning and greetings from spain!
My name is Mike Lusian and I currently study and work at the Autonomous University of Barcelona. This is my first post in this forum. In the last weeks I learned how to model with GAMS.
However I have a question regarding the display of equations.
What you look at is a part of my goal function (the goal function itself is not important):
Goal =e= sum((k,l,p), B(k,l,p)*v(q,w)) + sum((g,k,p), T(g,k,p)*v(q,w)) + sum((r,u,p), O(r,u,p)*v(q,w))
Is it possible to display the costs of each summand? For example I want to display something like this after solving the model:
sum((k,l,p), B(k,l,p)*v(q,w)) = 213876.378
sum((g,k,p), T(g,k,p)*v(q,w)) = 9271.342
sum((r,u,p), O(r,u,p)*v(q,w) )= 128972.993
Or is there any other way how I can see how costly each individual summand is?
Thanks in advance and nice to meet you!
Display costs of Summands after solving model
-
- User
- Posts: 3
- Joined: 1 year ago
Display costs of Summands after solving model
Last edited by mikelusian 1 year ago, edited 1 time in total.
Re: Show Cost of Summands after solving model
You will need to program this. For example:
-Michael
Code: Select all
Goal1 =e= (sum((k,l,p), B(k,l,p)*v(q,w));
Goal2 =e= sum((g,k,p), T(g,k,p)*v(q,w));
Goal3 =e= sum((r,u,p), O(r,u,p)*v(q,w));
Goal =e= Goal1 + Goal2 + Goal3;
...
display Goal1.l, Goal2.l,Goal3.l;
-
- User
- Posts: 3
- Joined: 1 year ago
Re: Display costs of Summands after solving model
Thank you it works!