MPSGE Soluition

Problems with modeling
Post Reply
nikolbe
User
User
Posts: 1
Joined: 5 years ago

MPSGE Soluition

Post by nikolbe »

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.
Attachments
Untitled_2.gms
(4.96 KiB) Downloaded 178 times
agrSAM.xlsx
(11 KiB) Downloaded 180 times
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: MPSGE Soluition

Post by Renger »

Hi

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.:

    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);
    
    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
    - 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).
I hope this helps.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply