# AMPL model file for the Farmer Jones problem # # The LP is # max Z = 30 x1 + 100 x2 (total revenue) # s.t. x1 + x2 <= 7 (land available) # 4 x1 + 10 x2 <= 40 (labor hrs) # 10 x1 >= 30 (min corn) # x1, x2 >= 0 (non-negativity) set Crops; # corn, wheat param Yield {j in Crops}; # yield per acre param Labor {j in Crops}; # labor hrs per acre param Price {j in Crops}; # selling price per bushel param Min_Crop {j in Crops}; # min levels of corn and wheat (bushels) param Max_Acres; # total land available (acres) param Max_Hours; # total labot hrs available var x {j in Crops} >= 0; # x[corn] = acres of corn, x[wheat] = acres of wheat maximize total_revenue: sum {j in Crops} Price[j]*Yield[j]*x[j]; subject to land_constraint: sum {j in Crops} x[j] <= Max_Acres; subject to labor_constraint: sum {j in Crops} Labor[j]*x[j] <= Max_Hours; subject to min_crop_constraint {j in Crops}: Yield[j]*x[j] >= Min_Crop[j];