Watch out for incomplete suppression

Top  Previous  Next

(trnssu.gms)

When one uses conditionals to eliminate variables one must be careful to watch out for cases of incomplete elimination.  Variables may still be there that you thought were gone.  Below, I do not suppress zero transport cost cases in the bottom 2 equations and will end up with variables present that trivially allow demand satisfaction.

 

TCOST =E= SUM((PLANT,MARKET)$cost(plant,market)

                             , SHIPMENTS(PLANT,MARKET)*COST(PLANT,MARKET));

fsSUPPLYEQ(PLANT)$supply(plant)..

      SUM(MARKET, SHIPMENTS(PLANT, MARKET))=L=  SUPPLY(PLANT);

fsDEMANDEQ(MARKET)$demand(market)..

      SUM(PLANT,  SHIPMENTS(PLANT, MARKET)) =G= DEMAND(MARKET);

 

You need to suppress variables in a consistent fashion across all equations.