I have 4 ingredients that I want to combine to prepare a drink:
| amount | pro | carbs | fats |
------------------------------------------------
[m]ilk | 100ml | 3.5 | 5.3 | 0.1 |
[o]ats | 100g | 11 | 62 | 7.7 |
oat[b]ran | 100g | 13 | 47 | 3.5 |
p[r]otein powder | 100g | 82 | 4 | 7.5 |
and I want my drink to have 30.8g of protein, 58.97g of carbs and 12.46g of fats. Considering
- $x$ = amount of milk, $y$ = amount of oats, $z$ = amount of oatbran, $v$ = amount of protein powder
- $m$ = milk, $o$ = oats, $b$ = oatbran, $r$ = protein powder
- $p$ = poteins needed in the drink, $c$ = carbs needed in the drink, $f$ = fats needed in the drink
- $p_m$ = proteins in 100ml of milk, $c_o$ = carbs in 100 gr of oats, and so on.
this is how I'm trying to formalize the problem: $$ \left\{ \begin{array}{c} x \cdot p_m/100 + y \cdot p_o/100 + z \cdot p_b/100 + v \cdot p_r/100 = p \\ x \cdot c_m/100 + y \cdot c_o/100 + z \cdot c_b/100 + v \cdot c_r/100 = c \\ x \cdot f_m/100 + y \cdot f_o/100 + z \cdot f_b/100 + v \cdot f_r/100 = f \end{array} \right. $$
or
$$ \left\{ \begin{array}{c} x \cdot p_m + y \cdot p_o + z \cdot p_b + v \cdot p_r = p \cdot 100 \\ x \cdot c_m + y \cdot c_o + z \cdot c_b + v \cdot c_r = c \cdot 100 \\ x \cdot f_m + y \cdot f_o + z \cdot f_b + v \cdot f_r = f \cdot 100 \end{array} \right. $$
in our case
$$ \left\{ \begin{array}{c} 3.5x + 11y + 13z + 82v = 3080 \\ 5.3x + 62y + 47z + 4v = 5897 \\ 0.1x + 7.7y + 3.5z + 7.5v = 1246 \end{array} \right. $$
Furthermore, I want my drink to always have 300 ml of milk, I could remove x from the system to get
$$ \left\{ \begin{array}{c} 11y + 13z + 82v = 2030 \\ 62y + 47z + 4v = 4307 \\ 7.7y + 3.5z + 7.5v = 1216 \end{array} \right. $$
but resolving this I'm getting a negative value for z=-208.88, that is not actually an option.
Now, I've studied these kinds of problem too many years ago, I'm not being able to go any further, so I'm here to ask: is this approach totally wrong? If not, how should I proceed to get a good (or exact) approximation for the variables, excluding negative values?