9.1 Introduction to optimization
Donkey Kong wants to make a 250 mL fruit smoothie. Being an ape, naturally he would like a large proportion of the smoothie to be bananas—at least 100 mL but not more than 150 mL. There should be at least 10 mL each of apples, cherries, and dates. However, for proper taste, there should be twice the amount of apples as cherries. The prices at the local supermarket are as follows:
Fruit | Price per mL (coins) |
---|---|
Apples | 10 |
Bananas | 2 |
Cherries | 5 |
Dates | 8 |
Donkey Kong wants to spend as few coins as possible on his smoothie.
(a) What are the design variables in this optimization problem?
(b) Translate the written description of the problem into a formal optimization problem statement (see Chapter 9 in the textbook). Label each expression as an objective function, inequality constraint, equality constraint, or bound on a design variable.
(c) Using any strategy you wish, find the values of the design variables that minimize the objective function while satisfying the constraints (i.e., solve the optimization problem). How many coins will the smoothie cost? (If you decide to use Matlab, see the linprog function; if you prefer Python, see scipy.optimize. Does the answer returned by the software make sense?)