Uploaded by lilikoi44

Excel Solver Optimization Instructions

advertisement
Name: _____________________________
Excel Solver Project/Activity:
Using Excel Solver for Optimization Problems
In this activity, you will learn how to use the Excel Solver to solve an optimization problem like those
we’ve learned how to solve in chapter 4. We will set up and solve the first problem together. Then you
will complete the problems at the end of this handout on your own. You may help each other on this
activity, but each person must hand in their own work individually to receive credit.
You will need to complete this activity prior to completing the Chapter 4 Project. You have until the day
the Chapter 4 project is due to turn in this activity to receive credit.
Basic Excel Tips
Below are some basic Excel tips to help you complete this activity.
 Each cell in Excel has an address referenced by the column letter (shown along the top) followed
by the row number (shown along the left side)
o The cell in the upper left corner is cell A1
 All formulas in Excel must start with an equal sign
o To add the values in cell A1 and A2, you would type =A1+A2
 You must tell Excel when to multiply (using the *)
o To multiply the values in cell A1 and A2, you would type =A1*A2
 Excel evaluates according to the standard order of operations. Use parentheses when needed!
Adding in Excel Solver
You will need the additional Solver add‐in to complete this activity. Follow the steps below to check if
your computer already has the Solver and add it if necessary. (We will also add in the Analysis Tool Pak
for later use.)
Note: If you are doing this on a computer off‐campus, you may need to have the installation CD available
to load the additional tools. Excel will prompt you if it is necessary.
Office 2010 & 2013
1. Click on the File Ribbon (at the top left of the window in Excel).
2. Click on Options at the bottom left of the menu.
3. In the dialogue pop up, choose “Add‐ins” on the left‐hand side.
4. Click on GO next to the words “Manage Excel Add‐ins” at the bottom of the window.
5. Make sure the boxes next to Analysis Tool Pak and Solver Add‐in are checked in the new
window that opens.
6. Click OK.
7. Allow Excel to install if prompted (insert disk/CD if prompted).
Office 2007
1. Click on the Office button (at the top left corner).
2. Click on Excel Options at the bottom right corner of the menu.
3. In the dialogue pop up, choose “Add‐ins” on the left‐hand side.
4. Click on GO next to the words “Manage Excel Add‐ins” at the bottom of the window.
5. Make sure the boxes next to Analysis Tool Pak and Solver are checked in the new window that
opens.
6. Click OK.
7. Allow Excel to install if prompted (insert disk/CD if prompted).
Office 2003
1. Go to the Tools Menu (make sure all options are displayed—click the double arrow at the
bottom of the menu if necessary).
2. Choose the Add‐Ins option from the Tools menu.
3. Make sure the boxes next to Analysis Tool Pak and Solver are checked in the new window that
opens.
4. Click OK.
5. Allow Excel to install (insert disk/CD if prompted).
You should now have access to the Excel Solver tool. To verify that you have installed the Solver, do the
following:
1. Click on the Data Ribbon in Excel.
2. At the far right, you should see a section called Analysis that contains Data Analysis and Solver.
Problem Statement
A company manufactures two products: cogs and sprockets. Cogs sell for $120 each and sprockets sell
for $80 each. The cost to produce each cog is $60 and the cost to produce each sprocket is $36.
Company policy requires that at least 1000 units total be manufactured each month. Cogs require five
hours of labor per unit, and sprockets require three hours of labor per unit. A total of 8000 hours are
available per month. Determine a monthly production schedule that will maximize the company’s
profit.
Problem Set Up
Before using the Solver, we need to determine our objective function and any constraints.
Objective Function
Start by setting up the objective function. In this case, it will reflect the company’s profit since that is
what we want to maximize.
In words, describe how you would calculate the company’s profit:
Before we can translate this idea from words into an equation, we need to define our variables. For this
problem, we will define them as follows:
x1  cogs manufactured per month
x2  sprockets manufactured per month
Now determine the objective function:
Constraints
Now find out what constraints affect our ability to manufacture cogs & sprockets.
In words, list the constraints that we need to consider for this problem:
(Hint: It may help to read the problem again).
Now let’s translate these constraints into mathematical inequalities:
Note: One nice thing about using the Excel Solver is that our optimization problems can have mixed
constraints and we don’t have to re‐write the problem in standard form to proceed!
Finding the Solution
This problem is reasonable enough for us to solve by hand, but as our problems get more complex and
we have more variables or larger numbers, it becomes more difficult as well as time consuming to solve
by hand.
An alternative is to use the Excel Solver to solve for us! The steps on the rest of this activity will walk
you through how to use the Excel Solver to find the solution to this problem.
1. Type “Cogs manufactured per month (x1)” into cell A2 and “Sprockets manufactured per month
(x2)” into cell A3 to represent the decision variables (what we want to know). Resize the column
to get the text to fit. (The easiest way to do this is to double click on the line between A & B)
2. Type “Profit (P)” into cell A5 to represent our objective function.
3. The Excel formula representing the objective function goes in cell B5. Type in the formula below
and hit enter:
=60*B2+44*B3
The value of x1 will be stored in cell B2 and the value of x2 will be stored in cell B3 (though
currently both cell B2 and cell B3 should be empty).
Remember that you have to tell Excel to multiply by using an asterisk (*) and all formulas should
start with an equal sign (=).
4. Enter guess values for x1 and x2 into cells B2 and B3 and record them below.
a. Initial guess for x1 :
b. Initial guess for x2 :
5. Type “Minimum production requirement” into cell A7.
6. The Excel formula for the expression on the left hand side of the minimum production constraint
goes in cell B7. Type in the formula below and hit enter:
=B2+B3
Again, the value of x1 will be stored in cell B2 and the value of x2 will be stored in cell B3.
7. In cell C7, type the inequality symbol and value on the right hand side of the production
constraint as shown below:
>=1000
8. Type “Labor restriction” into cell A8.
9. The Excel formula for the expression on the left hand side of the labor constraint goes in cell B8.
Type in the formula below and hit enter:
=5*B2+3*B3
Again, the value of x1 will be stored in cell B2 and the value of x2 will be stored in cell B3.
10. In cell C8, type the inequality symbol and value on the right hand side of the labor constraint as
shown below:
<=8000
11. Notice that we did not enter the non‐negative constraints for x1 and x2 . We already have cells
that will contain these values so we do not need to re‐enter them. We will enter the constraints
directly into the solver in the next section.
Now we’re ready to use the solver!
12. Go to the Data Ribbon and click on Solver. (For Excel 2003, the Solver is found in the Tools
menu.)
13. Click in the white space to the right of the words “Set Objective:” and then click on cell B5 in
your worksheet (the cell containing the objective function).
Note:
In earlier versions of Excel, you will see “Set Target Cell:” instead of “Set Objective:”
14. Choose “Max” to the right of the words “To:” since we are trying to maximize our objective
function (the profit) in this case.
Notes:
 To minimize the objective function, you would select the “Min” option.
 In earlier versions of Excel, you will see “Equal To:” instead of “To:”
15. Click in the white space below the words “By Changing Variable Cells:” and then click and drag to
select the cells containing your values of the decision variables and hit Enter. In this case, it
should be cells B2 and B3 in your worksheet.
Note:
In earlier versions of Excel, you will see “By Changing Cells:” instead of “By Changing Variable
Cells:”
16. Click on the word Add to the right of the white space below the words “Subject to the
Constraints.” This is where you will add each of your constraints.
17. Add the minimum production and labor constraints by following the steps below for each
constraint:
a. Click in the white space below the words “Cell reference:”
b. Click on the cell containing your constraint formula. (B7 for production; B8 for labor)
c. Choose the correct inequality symbol from the drop down menu.
d. Enter the number value on the right hand side of the constraint in the box under the
word “Constraint.”
e. Click Add to add your next constraint or OK if you are entering your final constraint.
18. Add the non‐negative constraints by following the steps below:
a. Click on Add if you are not already in the constraint window.
b. Click in the white space below the words “Cell reference:”
c. Click on the cell containing the decision variable.
d. Choose the >= inequality symbol from the drop down menu.
e. Enter 0 on the right hand side of the constraint in the box under the word “Constraint.”
f. Click Add to add your next constraint or OK if you are entering your final constraint.
Note:
In Excel 2010 and 2013, you also have the option of checking the box next to the words “Make
Unconstrained Variables Non‐negative” instead of entering each non‐negative constraint
individually.
In earlier versions of Excel, you will find a similar option by clicking on the Options button in the
solver window. Then check the box next to the words "Assume Non‐Negative" towards the
bottom of the window.
You should now have 4 constraints entered into the Solver. You should see them in the main Solver
window once you click OK after entering your final constraint.
Tip:
If you forget which constraints you have already added, you can always click OK to go back to the
main solver window and see the list of constraints you have entered. To add any additional
constraints, just click on the Add button again.
19. You should now be back at the main solver window.
20. If you are using Excel 2010 or 2013, click on the drop down menu next to the words “Select a
Solving Method:” and choose the option SimplexLP.
Note:
If you are using an earlier version of Excel, click on the Options button. Then check the box next
to the words "Assume Linear Model" towards the bottom of the window.
21. Verify that you have entered all your information and click “Solve.”
22. Record the entire solution the Excel Solver provides below.
a. How many cogs should you produce to maximize profit?
b. How many sprockets should you produce to maximize profit?
c. What is the maximum profit?
d. Did you meet the minimum production requirement? How do you know?
e. How much labor is used?
23. Does the solution that the Excel Solver found make sense? Why or why not?
24. Using your solver results, briefly summarize the monthly production schedule that the company
should follow in order to maximize profit.
Now that you are familiar with using the Excel Solver for optimization problems, set up and solve the
problems on the next three pages using the Excel Solver.
Problem 1:
A contractor builds two types of homes: the Carolina and the Savannah. The Carolina requires one lot,
$160,000 in capital, and 160 worker‐days of labor. The Savannah requires one lot, $240,000 in capital,
and 160 worker‐days of labor. The contractor owns 300 lots and has $48,000,000 of available capital,
and 43,200 worker‐days of labor. The profit on the Carolina is $40,000 and the profit on the Savannah is
$50,000. Determine how many of each home type the contractor should build in order to maximize
profit and find the maximum profit.
Decision Variables:
Objective Function:
Constraints:
Solution & Interpretation of Solution:
Problem 2:
Nekita Corporation assembles regular cell phones and camera cell phones at two different factories
within the same city. During each hour at the first factory, 15 regular cell phones and 30 camera cell
phones can be assembled at a cost of $100 per hour. During each hour at the second factory, 10 regular
cell phones and 60 camera cell phones can be assembled at a cost of $150 per hour. Nekita expects
weekly orders for at least 15,000 regular cell phones and at least 45,000 camera cell phones. How many
hours per week should the company schedule at each location to be able to fill the orders at minimum
cost? What is the minimum cost?
Decision Variables:
Objective Function:
Constraints:
Solution & Interpretation of Solution:
Problem 3:
Johnson City Cooperage manufactures 30‐gallon and 55‐gallon fiber drums. Each 30‐gallon drum takes
30 minutes to make, each 55‐gallon drum takes 40 minutes to make, and the company has at most
10,000 minutes available each week. Also, workplace limitations and product demand indicate that the
number of 55‐gallon drums produced plus half the number of 30‐gallon drums produced should be at
least 160, and the number of 30‐gallon drums should be at least twice the number of 55‐gallon drums.
Johnson City Cooperage’s manufacturing costs are $4 for each 30‐gallon drum and $6 for each 55‐gallon
drum. How many of each drum should be made each week to satisfy the production constraints and
minimize production cost? Find the minimum production cost.
Decision Variables:
Objective Function:
Constraints:
Solution & Interpretation of Solution:
Download