Thursday, November 20, 2008

More on the diet problem

Yesterday I started a linear programming formulation of the diet problem to minimize carbohydrate intake with constraints on calories, protein, and calories from fat. I gave three food solution to that three constraint problem. Today I want to extend that a little to more foods by adding some constraints.

The specific model I looked at yesterday was to minimize carbohydrates subject to calories between 1800 and 2200, protein between 77 and 95 grams, and calories from fat less than 220.by picking from CarbWatch yogurt, a cracker w/peanut butter, frozen cauliflower w/ low fat cheese sauce, and banana.

The 3 food solution was 5 yogurts, 6 bananas, and 14 servings of the cauliflower per day.

Let’s add a cost constraint of no more than $15 per day. The yogurt is 44c each, the cauliflower is $1 each. a banana is 30c, and a cracker w/ peanut butter is about 25c.

Let’s also add some foods. Add coffee, with a minimum of a cup a day. Also add tomato juice. Coffee has 5 calories (none from fat), .20 grams of protein and .90 grams of carb. Amost water. I estimate cost at about 25c per cup. A cup of tomato juice has 40 calories, 2 grams of protein and 10 grams of carbs. Cost is about 50c.

Adding the cost constraint gives a solution with less cauliflower and more yogurt and bananas.

Number of variables: 6.
Number of constraints: 7.
Minimization of objective function.

Primary objective function value: 3.18337136949888E+02
Dual objective function value: 3.18337136949887E+02
No. Name Value Reduced Cost Description
1 yogurt 5.618047 0
2 caulwsauce 9.532569 0
3 peanutbuttercrack 0 82.76391
4 banana 8.318303 0
5 coffee 1 0
6 tomatoejuice 0 3.546323
No. Constraint Dual Value Activity (A*x) Relaxation |b - A*x|
1 maxprotein -1.42217 95 0
2 minprotein 0 77 0
3 calories 0 2200 0
4 calfromfat 0 220 0
5 mincalories 0.287585 1800 0
6 cost -4.41075 15 0
7 coffee 1.951885 1 0

Although this says we have 7 constraints, the number of constraints that matters is the number of binding constraints. In our case we can have at most 5 binding constraints since we have separate constraints for upper and lower limits on protein and calories. In our minimum barbohydrate solution we are pushing the upper limi on protein and the lower limit on calories and are not binding on our limit on calories from fat. That suggests we need a diet with more fat in it. So I need to add some low carb, high fat foods to select from. I’ll do that tomorrow.

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home