# AMPL Model file for the diet problem set NUTR; # The nutrients set FOOD; # The food items available param cost {FOOD} >= 0; # The cost of one unit of each food item param rda_min {NUTR} default 0; # Minimum RDA for each nutrient (milligrams) param amt {NUTR,FOOD} >= 0; # The milligrams of nutrient in one unit of food var Buy {j in FOOD} >= 0; # Number of units of each food item to buy minimize Total_Cost: sum {j in FOOD} cost[j] * Buy[j]; subject to Diet {i in NUTR}: rda_min[i] <= sum {j in FOOD} amt[i,j] * Buy[j];