I am trying to solve SAM table. It is normalized. Data comes from excel. Solver solution reports three following errors
**** Error: no coefficients found for LI
**** Error: no source for P_I
**** Error: no sink for P_I
I believe that there is a problem with my demand block for GOV. But I am unable to identify it. SAM and code are attached.
I would be very grateful if somebody could help me.
MPSGE Soluition
MPSGE Soluition
- Attachments
-
- Untitled_2.gms
- (4.96 KiB) Downloaded 182 times
-
- agrSAM.xlsx
- (11 KiB) Downloaded 183 times
Re: MPSGE Soluition
Hi
You use the wrong index for investments: in your table, it is indexed by "SI", and in your model by "S-I".
Cheers
Renger
You use the wrong index for investments: in your table, it is indexed by "SI", and in your model by "S-I".
- - You should force GAMS to check your table on errors like these by defining SAM over the set of all SAM elements. E.g.:
If you now would read SAM from the excel sheet, GAMS would complain about using sam("S-I", ...) as "S-I" is not an element of SAMELE
Code: Select all
set ac All SAM elements /a_min, apetroil, a_ael, ane c_min, ... and the rest of the SAM elements /. alias(ac, aac); parameter sam(ac, aac);
- Furthermore, it is better to use the gdxxrw utility as it has many more possibilities. You could, for example, read the first row of your SAM table as a set and read the first column to add elements not part of the row. One of my main pieces of advice to GAMS users is to study the gdxxrw extensively as it can save you so much time.
- If you read a SAM from a table you should always check if the table is consistent (e.g. sum of row = sum of column).
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist