You are on page 1of 7

Page 1 of 7

Linear optimization using excel solver


M.Narayana Reddy and K.V.Kumar

Problem 1

Suppose you are the manager of a diary farm, and one of your responsibility is to
determine a livestock feed mixture that meets certain protein requirements but is still cost
effective. Ingredient costs are continually changing, and as they change, you must
recalculate the ingredient mix to minimize cost. You have the following information

1. The feed mixture is composed of Oats , Corn and Barley having the percentage
of protein contents are 9.5%,8.5% and 9.0% respectively.

2. The prices per lb are given below


Oats $0.23,
Corn $0.08 and
Barley $0.14

3. The final mix must have a protein concentration must be between 9.2% and
9.5%

Find the optimum solution to the above problem to minimize the cost ingredients in such a
way that

1. The final mixture must have a protein concentration must be between 9.2% and
9.5%
2. The amount of each ingredient must be at least 0 lbs.
3. The total of the ingredient must equal to 100%

***
1. Enter the given data in a worksheet as displayed below

A B C D E F G H
1
2 lbs feed in cost per lbs protein/
3 Feed % Price/lb 100 lbs 100 100 lbs
Protein mix lbsmix mix
4 Oats 9.50% 0.23
5 Corn 8.50% 0.08
6 Barley 9.00% 0.14
7 %
Protein

2. Place pointer in Cell E7 and type the formula as

Linear optimization using excel solver 1


=SUM(E4:E6)

to calculate the total of the ingredients

3. Copy the formula in Cell E7 to F7 and G7 Cells

4. Place the pointer in Cell F4 and type the formula as

=E4*D4

to calculate the Cost per 100 lbs mix of Oats

5. Copy the formula in Cell F4 to F5 and F6 Cells

6. Place the pointer in Cell G4 and type the formula as

=E4*C4

to calculate the protein concentration of the 100 lbs of Oats mix.

7. Activate the SOLVER option from TOOLS menu of the main menu to get the
solver parameters screen as shown below

Input the following information to the above screen

8. Target Cell : The target Cell is the specific objective of the problem. The cell
value will be set automatically by either minimizing or maximizing or a specific
value by the solver. In this problem the target cell is the cost of the final mix ,
which is to be minimized, That is Cell F7
9. Select MIN for equal to option, that is, the cost of the final mixture is to be
minimized by the solver.
10. Changing Cells: Changing Cell are cells whose value solver will manipulate to
get the target cell objective. In this problem proportion of the each ingredient in
the final mix.

Type E4:E6 as Changing Cells

11. Constraints : Constraints are the limitations set on the values in any of these
Cells. In this problem the constraints are to be defined as follows
12. CLICK ADD to get the following ADD CONSTRAINTS Screen

13. Type the first constraint, that is, the amount of each ingredient must be at least
0 lb as follows

Type Cell Reference as E4:E6


Select the Mathematical Sign as >=
Type the constraint as 0

14. CLICK ADD to add more constraints to the objective function individually as
given below.

Cell Sign Constraints


Reference

E7 = 100 ( The total of the ingredient must be equal to 100)


G7 >= 9.2%( The final protein concentration must be
G7 <= 9.5% between 9.2% and 9.5%)

15. Finally CLICK OK to get the SOLVER PARAMETERS Screen with the filled
information as shown above

16. CLICK on the SOLVE to start solver to keep the optimum values in the
relevant positions and will be displayed the following screen
17. Select the KEEP SOLVER SOLUTION option to retain the optimum values
in the table.

18. Select ANSWER, SENSITIVITY and LIMITS from the above screen to get
the solver reports

19. ANSWER Report : Lists the target cell and the adjustable cells with their
original and final values, constraints, and information about the constraints.

Microsoft Excel 8.0 Answer Report


Worksheet: [solv1.xls]Sheet1
Report Created: 10/9/97 10:37:43 AM

Target Cell (Min)


Cell Name Original Final
Value Value
$F$7 100 lbsmix 0.00 17.60

Adjustable Cells
Cell Name Original Final
Value Value
$E$4 Oats 100 lbs mix 0.00 40.00
$E$5 Corn 100 lbs mix 0.00 0.00
$E$6 Barley 100 lbs 0.00 60.00
mix

Constraints
Cell Name Cell Value Formula Status Slack
$E$7 100 lbs mix 100.00 $E$7=100 Binding 0
$ 100 lbs mix 9.20 $G$7>=9. Binding 0.00
G$7 2
$ 100 lbs mix 9.20 $G$7<=9. Not 0.300000126
G$7 5 Binding
$E$4 Oats 100 lbs mix 40.00 $E$4>=0 Not 40.00
Binding
$E$5 Corn 100 lbs mix 0.00 $E$5>=0 Binding 0.00
$E$6 Barley 100 lbs 60.00 $E$6>=0 Not 60.00
mix Binding

20. SENSITIVITY Report : Provides information about how sensitive the solution
is to small changes in the formula in the Set Target Cell box in the Solver
Parameters dialog box or the constraints. This report is not generated for
models that have integer constraints. For nonlinear models, the report provides
values for reduced gradients and Lagrange multipliers. For linear models, the
report includes reduced costs, shadow prices, objective coefficient (with
allowable increase and decrease), and constraint right-hand side ranges.

Microsoft Excel 8.0 Sensitivity Report


Worksheet: [solv1.xls]Sheet1
Report Created: 10/9/97 10:37:46 AM

Adjustable Cells
Final Reduced
Cell Name Value Gradient
$E$4 Oats 100 lbs mix 40.00 0.00
$E$5 Corn 100 lbs mix 0.00 0.03
$E$6 Barley 100 lbs 60.00 0.00
mix
Constraints
Final Lagrang
e
Cell Name Value Multiplie
r
$E$7 100 lbs mix 100.00 -1.48
$ 100 lbs mix 9.20 18.00
G$7
$ 100 lbs mix 9.20 0.00
G$7

21. LIMITS Report : Lists the target cell and the adjustable cells with their
respective values, lower and upper limits, and target values. This report is not
generated for models that have integer constraints. The lower limit is the
smallest value that the adjustable cell can take while holding all other adjustable
cells fixed and still satisfying the constraints. The upper limit is the greatest
value.
Microsoft Excel 8.0 Limits Report
Worksheet: [solv1.xls]Sheet1
Report Created: 10/9/97 10:37:46 AM

Target
Cell Name Value
$F$7 100 lbsmix 17.60

Adjustable Lowe Target Uppe Target


r r
Cell Name Value Limit Result Limit Result
$E$4 Oats 100 lbs mix 40.00 40.00 17.60 40.00 17.60
$E$5 Corn 100 lbs mix 0.00 0.00 17.60 0.00 17.60
$E$6 Barley 100 lbs 60.00 60.00 17.60 60.00 17.60
mix
Problem 2:

Maximize Z = X1 +9X2 +X3


Subject to Constraints
X1 + 2x2 + 3x3 <= 9
3x2 + 2x2 + 2x3 <=15
With all variables are nonnegative.
For the above problem enter the data in the following format

A B C D
1 Coefficient Variables Z Constraint
s (X) s
2
3 1 0 0
4 9 0 0
5 1 0
6 0 Objective
Function

Hints

1. Enter the formula in C3 cell as = A3*B3


2. Copy the formula Cell C3 to C4 and C5
3. Enter the formula in Cell C6 as = SUM(C3:C5). This Cell C6 became
Objective function of the problem and Target Cell, which is to be
maximized, for the SOLVER Tool
4. Enter the formula in Cell D3 as B3+2*B4+3*B5. This Cell D3 becomes
the cell reference for the first constraints in SOLVER Tool
5. Similarly enter the formula in Cell D4 as 3*B3+2*B4+2*B5. This Cell
D4 becomes the cell reference for the Second constraints in SOLVER
Tool.
Problem 3

MAXIMIZE Z = 5X1 + 2X2

Subject to the Constraints


6X1 + X2 >= 6
4X1 + 3X2 >=12
X1 + 2X2 >= 4

With all variables are non-negative


Problem 4

MINIMIZE Z = 14X1 +13X2 +11X3 + 13X4 + 13X5 + 12X6

Subject to the Constraints

X1 + X2 + X 3 =1200

+ X 4 + X5 + X 6 =1000

X1 + X4 =1000

X2 + X5 = 700

X3 + X6 =500

WITH ALL VARIABLES ARE NONNEGETIVE

Problem 5

MINIMIZE Z = 3X1 + 2X2 + 4X3 + 6X4

Subject to the Constraints

X1 + 2X2 + X3 + X4 >= 1000


2X1 + X2 + 3X3 + 7X4 >= 1500

With all variables are non negative

You might also like