Math Help
80
I'm dealing with what I believe is a linear programming problem, however I'm not sure.
I'm having trouble figuring out what my constraints are and my objective function.
If I have a given set of ingredients, let's say apples and chicken, how much of each ingredient should I eat to get as close as possible to my nutrient goals: fat 20, protein 22, carbs 10.
Per 100g
Apple:______fat: 0g_____protein: 1g _____carbs: 16g
Chicken:___ fat: 4g_____protein: 20g____carbs: 0g
So my decision variable are:
a = 100g of apples
c = 100g of chicken
A first I thought these were my constraints:
Fat________20 = 0a + 4c
Protein___22 = 1a + 20c
Carb______10 = 16a + 0c
a>=0
c>=0
In a perfect world there would always be an answer to this system. But I would think in most cases there will be instances where we can only get close to our nutrient goals. So would these actually be objective functions?
min = -20 + 0a + 4c
min = -22 + 1a + 20c
min = -10 + 16a + 0c
Can you then make it one objective function?:
min = (-20 + 0a +4c) + (-22 + 1a +20c) +(-10+16a+0c)
min = -52 + 17a + 24c
This doesn’t seem right though, because then what are my constraints? I’m a bit confused. Feels like I went wrong somewhere. Do you have any guidance for me?