$ondollar title Top Brass (LP) Example 5.1 of Rardin (1998) (modified) * comment out the following lines to get full effect of the listing file * * $offsymxref offsymlist offuelxref offuellist offupper * option limrow = 0, limcol = 0; set I/football, soccer/; free variable profit "total profit"; positive variables x(I) "trophies"; * DATA section parameters profitMargin(I) / "football" 12 , "soccer" 9 / boardFeet(I) / "football" 4 , "soccer" 2 / plaques(I) / "football" 1 , "soccer" 1 /; scalar plaquesMax /1750/ woodMax /4800/ footballMax /1000/ soccerMax /1500/; * MODEL section equations obj "max total profit" foot "bound on the number of brass footballs used" socc "bound on the number of brass soccer balls used", plaq "bound on the number of plaques to be used", wood "bound on the amount of wood to be used"; obj.. profit =e= sum(I, profitMargin(I)*x(I)); foot.. x("football") =l= footballMax; socc.. x("soccer") =l= soccerMax; plaq.. sum(I,plaques(I)*x(I)) =l= plaquesMax; wood.. sum(I,boardFeet(I)*x(I)) =l= woodMax; model topbrass /all/; * SOLVE solve topbrass using lp maximizing profit; * POSTPROCESS: print the percentages of football and soccer trophies * in the final result. parameter pct(I) "holds the final percentages"; alias (I,J); * calculate and display the percentages pct(I) = 100 * x.l(I) / (sum(J,x.l(J))); display pct;