Q: You are creating a batch of protein bars and want your product to have as much protein in it as possible using two food sources A & B. Source A provides 5g of protein per pound and source B provides 4g of protein per pound. In a batch of the protein bar you do not want more than 4 pounds in total weight. Source A costs $2/pound and B $1/pound. You also want to keep the price of the entire batch to be lesser than $5.
Practical Optimization
A: This is a good example of an application for the simplex algorithm. The simplex algorithm works quite well for problems that can be formulated in a linear manner with linear constraints. For example, if we assume the optimal amount of source A is \(x\) pounds and source B is \(y\) pounds, the objective function we want to maximize (the protein in the bars) can be formulated as follows
$$
\text{Protein} = 5x + 4y\\
$$
subject to constraints
$$
x + y \le4\\
2x + y\le 5\\
$$
The optimal solution can be found using the simplex algorithm. The algorithm is readily available in R under the package "boot". The function "simplex" solves this readily for you. Here is the R code for the same, yielding an optimal solution of A=1,B=3
The simplex algorithm is widely used and you can extend its application to other areas too. Some good books to learn the art of optimization
Convex Optimization
Optimization in Operations Research
Nonlinear Multiobjective Optimization: A Generalized Homotopy Approach (International Series of Numerical Mathematics)
Practical Optimization
A: This is a good example of an application for the simplex algorithm. The simplex algorithm works quite well for problems that can be formulated in a linear manner with linear constraints. For example, if we assume the optimal amount of source A is \(x\) pounds and source B is \(y\) pounds, the objective function we want to maximize (the protein in the bars) can be formulated as follows
$$
\text{Protein} = 5x + 4y\\
$$
subject to constraints
$$
x + y \le4\\
2x + y\le 5\\
$$
The optimal solution can be found using the simplex algorithm. The algorithm is readily available in R under the package "boot". The function "simplex" solves this readily for you. Here is the R code for the same, yielding an optimal solution of A=1,B=3
The simplex algorithm is widely used and you can extend its application to other areas too. Some good books to learn the art of optimization
Convex Optimization
Optimization in Operations Research
Nonlinear Multiobjective Optimization: A Generalized Homotopy Approach (International Series of Numerical Mathematics)
Comments
Post a Comment