Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 1 GAMS Rev 121 Linux/Intel 1 $ondollar title Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 2 3 * comment out the following lines to get full effect of the listing file 4 * 5 * $offsymxref offsymlist offuelxref offuellist offupper 6 * option limrow = 0, limcol = 0; 7 8 set I/football, soccer/; 9 10 free variable profit "total profit"; 11 12 positive variables 13 x(I) "trophies"; 14 15 * DATA section 16 17 parameters 18 profitMargin(I) / "football" 12 , "soccer" 9 / 19 boardFeet(I) / "football" 4 , "soccer" 2 / 20 plaques(I) / "football" 1 , "soccer" 1 /; 21 22 scalar 23 plaquesMax /1750/ 24 woodMax /4800/ 25 footballMax /1000/ 26 soccerMax /1500/; 27 28 * MODEL section 29 30 equations 31 obj "max total profit" 32 foot "bound on the number of brass footballs used" 33 socc "bound on the number of brass soccer balls used", 34 plaq "bound on the number of plaques to be used", 35 wood "bound on the amount of wood to be used"; 36 37 obj.. 38 profit =e= sum(I, profitMargin(I)*x(I)); 39 40 foot.. 41 x("football") =l= footballMax; 42 43 socc.. 44 x("soccer") =l= soccerMax; 45 46 plaq.. 47 sum(I,plaques(I)*x(I)) =l= plaquesMax; 48 49 wood.. 50 sum(I,boardFeet(I)*x(I)) =l= woodMax; 51 52 model topbrass /all/; 53 54 * SOLVE Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 2 GAMS Rev 121 Linux/Intel 55 56 solve topbrass using lp maximizing profit; 57 58 * POSTPROCESS: print the percentages of football and soccer trophies 59 * in the final result. 60 61 parameter pct(I) "holds the final percentages"; 62 alias (I,J); 63 64 * calculate and display the percentages 65 pct(I) = 100 * x.l(I) / (sum(J,x.l(J))); 66 display pct; 67 68 COMPILATION TIME = 0.000 SECONDS 0.7 Mb LNX200-121 Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 3 Equation Listing SOLVE topbrass USING LP FROM LINE 56 GAMS Rev 121 Linux/Intel ---- obj =E= max total profit obj.. profit - 12*x(football) - 9*x(soccer) =E= 0 ; (LHS = 0) ---- foot =L= bound on the number of brass footballs used foot.. x(football) =L= 1000 ; (LHS = 0) ---- socc =L= bound on the number of brass soccer balls used socc.. x(soccer) =L= 1500 ; (LHS = 0) ---- plaq =L= bound on the number of plaques to be used plaq.. x(football) + x(soccer) =L= 1750 ; (LHS = 0) ---- wood =L= bound on the amount of wood to be used wood.. 4*x(football) + 2*x(soccer) =L= 4800 ; (LHS = 0) Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 4 Column Listing SOLVE topbrass USING LP FROM LINE 56 GAMS Rev 121 Linux/Intel ---- profit total profit profit (.LO, .L, .UP = -INF, 0, +INF) 1 obj ---- x trophies x(football) (.LO, .L, .UP = 0, 0, +INF) -12 obj 1 foot 1 plaq 4 wood x(soccer) (.LO, .L, .UP = 0, 0, +INF) -9 obj 1 socc 1 plaq 2 wood Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 5 Model Statistics SOLVE topbrass USING LP FROM LINE 56 GAMS Rev 121 Linux/Intel MODEL STATISTICS BLOCKS OF EQUATIONS 5 SINGLE EQUATIONS 5 BLOCKS OF VARIABLES 2 SINGLE VARIABLES 3 NON ZERO ELEMENTS 9 GENERATION TIME = 0.000 SECONDS 1.3 Mb LNX200-121 EXECUTION TIME = 0.000 SECONDS 1.3 Mb LNX200-121 Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 6 GAMS Rev 121 Linux/Intel S O L V E S U M M A R Y MODEL topbrass OBJECTIVE profit TYPE LP DIRECTION MAXIMIZE SOLVER CPLEX FROM LINE 56 **** SOLVER STATUS 1 NORMAL COMPLETION **** MODEL STATUS 1 OPTIMAL **** OBJECTIVE VALUE 17700.0000 RESOURCE USAGE, LIMIT 0.010 1000.000 ITERATION COUNT, LIMIT 2 10000 GAMS/Cplex Mar 21, 2001 LNX.CP.CL 20.0 019.019.039.LNX For Cplex 7.0 Cplex 7.0.0, GAMS Link 19 Optimal solution found. Objective : 17700.000000 LOWER LEVEL UPPER MARGINAL ---- EQU obj . . . 1.0000 ---- EQU foot -INF 650.0000 1000.0000 . ---- EQU socc -INF 1100.0000 1500.0000 . ---- EQU plaq -INF 1750.0000 1750.0000 6.0000 ---- EQU wood -INF 4800.0000 4800.0000 1.5000 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 LOWER LEVEL UPPER MARGINAL ---- VAR profit -INF 17700.0000 +INF . profit total profit ---- VAR x trophies LOWER LEVEL UPPER MARGINAL football . 650.0000 +INF . soccer . 1100.0000 +INF . **** REPORT SUMMARY : 0 NONOPT 0 INFEASIBLE 0 UNBOUNDED Top Brass (LP) Example 5.1 of Rardin (1998) (modified) 09/10/01 11:07:43 PAGE 7 E x e c u t i o n GAMS Rev 121 Linux/Intel ---- 66 PARAMETER pct holds the final percentages football 37.143, soccer 62.857 EXECUTION TIME = 0.000 SECONDS 1.3 Mb LNX200-121 USER: Computer Sciences Dept. G010628:1627AS-LNX University of Wisconsin-Madison DC2621 **** FILE SUMMARY INPUT /afs/cs.wisc.edu/u/s/w/swright/public/html/635/examples/topbrass5.gms OUTPUT /afs/cs.wisc.edu/u/s/w/swright/public/html/635/examples/topbrass5.lst