I'm trying to formulate a linear program for this problem:
There is a blacksmith who can produce $n$ different alloys, where alloy $i$ sells for $p_i$ dollars per unit. One unit of alloy $i$ takes $g_i$ grams of gold and $s_i$ grams of silver to produce. The blacksmith has a total of $G$ grams of gold and $S$ grams of silver to work with, and can produce as many units of each type of alloy as they want within the material constraints. The blacksmith is allowed to produce and sell a non-integer number of units of each alloy.
I think I came up with a solution, but it seems way too simple, and I think I'm missing something in my understanding of linear programming. This is my thought process:
Each alloy $a_i$ sells for $p_i$ dollars, so we can represent our profit as $P = \sum_{i=1}^{n} p_i a_i$.
Each $a_i$ costs $g_i$ and $s_i$ to make, so for each $a_i$, we have $C(a_i) = g_i + s_i$, where $C(a_i)$ is the cost of $i$th alloy.
This is the part I'm iffy on: We're given that we have $G$ and $S$ amounts of gold and silver. I'm not quite sure what the proper way of representing the constraints is.
What I was thinking is that the sum of all $C(a_i)$ must be less than or equal to $G + S$, i.e. $\sum_{i=1}^{n} (g_i + s_i) \le G + S$. But I am not sure how to connect this back to the profit and cost functions we have above.
Am I on the right track? What is the smart way to represent constraint functions for linear programs?