Daily requirements of 70 g of protein, 1 g calcium, 12 mg iron, and 3000 calories are needed for a balanced diet. The following foods are available for consumption with the cost and nutrients per 100 g as shown.
Protein
(g)
Calories
Calcium
(g)
Iron
Cost
GH¢
Brown Bread
12
246
0.1
3.2
0.5
Cheese
24.9
423
0.2
0.3
2
Butter
0.1
793
0.03
0
1
Baked Beans
6
93
0.05
2.3
0.25
Spinach
3
26
0.1
2
0.25
The objective is to find a balanced diet with minimum cost.
(a) Formulate a linear programming model for this problem.
(b) Use solver to find optimal solution and sensitivity report.
a) The objective is to find a balanced diet with minimum cost.
Let:
"x_1" - number of 100 g units of brown bread
"x_2" - number of 100 g units of cheese
"x_3" - number of 100 g units of butter
"x_4" - number of 100 g units of baked beans
"x_5" - number of 100 g units of baked beans
The linear programming problem is then:
Minimize: "0.5x_1 + 2x_2 + x_3 + 0.25x_4 + 0.25x_5"
Constraints:
"12x_1 + 24.9x_2 + 0.1x_3 + 6.0x_4 + 3.0x_5 \\geq 70"
"246x_1 + 423x_2 + 793x_3 + 93x_4 + 26x_5 \\geq 3000"
"0.1x_1 + 0.2x_2 + 0.03x_3 + 0.05x_4 + 0.1x_5 \\geq 1"
"3.2x_1 + 0.3x_2 + 2.3x_4 + 2.0x_5 \\geq 12"
"x_1,x_2,x_3,x_4,x_5\\geq0"
b) Using online solver (https://cbom.atozmath.com), we get:
It was used Two-Phase Simplex method.
Phase 1:
after 1st step: maz "z_j-c_j=793.13"
after 2nd step: max "z_j-c_j=25.33"
after 3rd step: max "z_j-c_j=3.06"
after 4th step: max "z_j-c_j=0.075"
after 5th step: all "z_j-c_j\\leq0"
optimal solution:
"min\\ z=0,x_1=0.56,x_2=1.95,x_3=2.41,x_4=0,x_5=4.81"
Phase 1:
we eliminate the artificial variables and change the objective function for the original,
after 1st step: max "z_j-c_j=0.17"
after 2nd step: max "z_j-c_j=0.001"
after 3rd step: all "z_j-c_j\\leq0"
Finally, optimal solution:
"z=\\$5.64"
"x_1=9.77, x_3=0.75,x_2=x_4=x_5=0"
Conclusion:
To get minimal cost ("\\$5.64" ) of diet, it's enough to use "977\\ g" of brown bread and "75\\ g" of butter. And we don't need any cheese, baked beans or spinach.
Comments
Leave a comment