Originally Posted by

**Bubba**
You might want to look at weighted average calculations. For instance a Runge-Kutta integrator for a physics system takes a weighted average of 4 distinct points to arrive at the final answer. I'm sure mathworld has a lot of information on computing weighted averages.

Runge-kutta computes k1,k2,k3 and k4. Then it does: final = 1/6 * ((k1 + (2 * k2) + (2* k3) + k4))

One thing is for certain is you will have to assign coefficients to each meal or meal ingredient in order to calculate the end result. You will need some type of formula to come up with a good coefficient that might take into account the number of calories, various cholesterol types, sugars, etc.

A first glance nieve approach is to find out how much a human needs of each one of the key categories you are using and produce ingredient coefficients based on that. You can then either average the coeffs. or do a weighted average on them to arrive at the final coefficient for the ingredient or meal. Then it's a simple matter of having the computer do some math to make sure the final coefficient for the meal is near some number.

I recommend you use normalized data to make the math simple.