Friday, November 21, 2008

Still more on the diet problem

The last couple of days I’ve been working on developing a linear programming model for a minimum carbohydrate diet that meets some restrictions on protein, calories, fat, and cost.

Yesterday I’d found a three food solution of
yogurt 5.6
cauliflower w/cheese sauce 9.5
banana 8.3
coffee 1

I guess that’s four foods if you count the cup of coffee.

Let’s add a couple of foods to the pool of foods for the model to choose from.

A spinach and apricot salad has 49 calories, none from fat, 12 g. of carbs and 2 g. of protein.

But that’s not really what I need to add to the mix. I need to find a high fat, low carb food to select from. Let’s try chili -- 194 calories, 68 from fat, 18 g. of carbs and 17 g. of protein.

Now we get a solution that looks like.

1 yogurt 4.763448 0
2 caulwsauce 0 0.827936
3 peanutbuttercrack 0 111.4818
4 banana 0 0.164621
5 coffee 1.292776 0
6 tomatoejuice 0 1.296119
7 spinaprsalad 18.79003 0
8 chili 2.534787 0
No. Constraint Dual Value Activity (A*x)
1 maxprotein -1.15522 95
2 minprotein 0 77
3 calories 0 2200
4 calfromfat -0.5715 220
5 mincalories 0.298708 1800
6 cost -0.72499 15
7 coffee 0 1

Like the last solution, this one has 3 foods plus coffee. But unlike the last solution this one is really a 4 food solution. The model forces at least 1 cup of coffee a day (I’m addicted). But that constraint isn’t binding in this solution, the optimal calls for 1.3 cups of coffee, more than the minimum.

The four constraints that are binding is the maximum limit on protein, the minimum level of calories, the maximum total cost, and the maximum number of calories from fat.

And although it’s a nice salad, almost 19 servings of the spinach/apricot salad a day isn’t really a satisfactory solution. Tomorrow I’ll add a couple new foods and look at some of the item costs more carefully.

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home