hw2_solution (1)

hw2_solution (1) - Question1 b AMPL MOD and DATA FILES set...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Question1- b- AMPL MOD and DATA FILES set dining; set resource; param price{dining}; param avail{resource}; param laborcost{dining}; param matcost{dining}; param cons{resource,dining}; var x{dining}>=0; maximize Tvalue: sum{j in dining}(price[j]-32*laborcost[j]-matcost[j])*x[j]; subject to res_con { i in resource}: sum{j in dining}cons[i,j]*x[j]<=avail[i]; set dining:= 1 2 3; set resource:= mach1 mach2 mach3; param: price laborcost matcost:= 1 2800 15 800 2 3100 22 680 3 2500 11 930; param avail:=mach1 400 mach2 625 mach3 200; param cons: 1 2 3:= mach1 2 3 2 mach2 5 4 1.5 mach3 1.5 1.3 .7;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Solution 2 iterations, objective 266250 ampl: display x; x [*] := 1 75 2 0 3 125 ; Question2: AMPL MOD and DATA FILES set Nutrition; set Food; param cost {Food}; #price per pound of food param reqNut {Nutrition}; #the required amount of each nutrient param amt {Nutrition, Food}; #the amount of nutrient gained for each pound of each type of food var x {j in Food} >= 0; #pounds of each type of food bought minimize Total_Cost: sum {j in Food} cost[j] * x[j]; #minimize the cost, which is the cost per pounds multiplies by the amount of pounds purchased for each type of food
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/08/2011 for the course IE 121 taught by Professor Perevalov during the Spring '08 term at Lehigh University .

Page1 / 7

hw2_solution (1) - Question1 b AMPL MOD and DATA FILES set...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online