Solver Introduction Week 8 Exercise

advertisement
EF 105: Excel Solver
Week 8 Exercise
Introduction
Many engineering problems cannot be solved by standard mathematical techniques; hence,
computer tools that “search” for a best solution are extremely useful. Solver enables one to
search over a range of constraints to find an optimum solution. Many engineering and
manufacturing optimization problems can be constructed on a Worksheet and solved using
Solver.
Discussion
To use Solver the user has only to provide the appropriate parameters requested in the box. The
parameters are:
 The target cell – the cell that contains the formula that we are trying to optimize the
calculation
 The type of optimization problem – the choices are to maximize the target, minimize
the target, or get the target cell to a particular value
 The cells to change – the variables of the problem
 Any constraints – these can be inequality constraints, equality constraints, or integer
constraints (meaning a variable must be integer valued)
Once all of the requested information is entered, a solution can be obtained by clicking on the
“Solve” button. As the last step, one can choose to keep Solver's solution or save the original cell
values as a scenario for future analysis and reports.
We shall illustrate the procedure of using Solver with the following example. Suppose that an
automotive manufacturing facility has the following excess production capacity:
Machine Type
Available Time (in hours/week)
Milling machine
20
Lathe
100
Grinder
50
and can manufacture two products, axles and wheels. Let the required machining (in hours per
unit production) be as follows:
Product
Axle
Wheel
Milling machine
0.75
0.00
Lathe
2.25
0.75
Grinder
0.50
0.25
Finally, assume that the profit is $55 per axle and $15 per wheel. How many axles and wheels
should they make?
The above problem can be defined as an Excel worksheet as shown below:
A
B
C
D
E
F
1
Axles
Wheels
Hours
4
4
2 Number to build
Used
Available
0.75
0
3
20
3 Hours per unit: Milling
2.25
0.75
12
100
4
Lathe
0.5
0.25
3
50
5
Grinder
$ 55.00
$ 15.00
6 Profit per unit
7
8
Total Profit
$ 280.00
9
In the worksheet, cells C2 and D2 are the cells to change (we initialize them with value 4). Cells
C3 to D6 contain the coefficients of the problem, the cost in hours and profit per unit production.
Cells E3 to E5 compute how many hours of each machine are used for the production entered in
the cells to change (for example, E3=C2*C3+D2*D3). Cells F3 to F5 contain the upper limit on
the hours. Finally, cell F8 is the target cell, the total profit, F8=C2*C6+D2*D6.
To maximize the profit, the following operations are used:
1) Select the “'Tool” menu and the “Solver” command. If you do not see the “Solver” command,
you need to install the solver. To do this, select the “Add-Ins” command and then “Solver Addin” in the “Tool” menu.
2) Choose to Maximize F8 by changing cells C2:D2 subject to the constraints E3:5  F3:5.
3) Click the "Solve" button to generate the solution: 53 1/3 wheels and 26 2/3 axles for a profit of
$2,266.67.
4) Unfortunately, it is impossible to make fractions of units, so add the constraint the C2 and D2
equal integers (click on the type of constraint and choose "int").
5) Clicking "Solve" generates the final solution of 53 wheels and 26 axles for a profit of $2,225.
Although Solver was designed to solve general optimization problems with constraints, it can
actually be easily used to solve many type of problems if one builds the right worksheet model
for the problem. You are encouraged to use the Excel on-line help to find more information
about the Solver.
Now it’s your turn to try it on your own:
Use different sheets within one spreadsheet for the solution to each problem, and name the sheets
appropriately. Try and keep your solution results at the top of each sheet and within the right
margin so that it will be easy to review and print. Type your name in the first sheet.
Problem 1 Using Solver, solve for the roots of the following cubic function:
x3 – 10x2 + 36x – 40 = 0
(Note: Choose “Value of:” on the Solver dialog box and set it to zero)
Problem 2 A company manufactures three types of chemicals. For the upcoming month, the
company has contracted to supply the following amounts of three chemicals:
Chemical
1
2
3
Contracted Sales (lbs)
2000
3500
1800
The company’s production is limited by the availability of processing time in two
chemical reactors (note that each chemical must be processed by each reactor). The
following table provides the hours of processing time available next month for each
reactor and the processing time required in each reactor per pound of each chemical:
Reactor Processing Times (hrs. per lb)
Chemical
1
2
3
0.05
0.04
0.01
0.02
0.06
0.03
Reactor 1
Reactor 2
Reactor
Availability
200 hours
150 hours
Due to the limited availability of reactor processing time, the company has insufficient
capacity to meet its demand with in-house production. Consequently, the company must
purchase some chemicals from other vendors having excess capacity and resell them to
customers. The following table provides each chemical’s in-house production cost and
outside purchase cost:
Chemical
1
2
3
In-house production cost
($ per lb)
2.50
1.75
2.90
Outside Purchase Cost
($ per pound)
2.80
2.50
3.25
The company’s objective is to fill its customer’s orders with the cheapest combination of
in-house production and outside purchases. Using Solver, find out how much of each
chemical to produce in-house and how much of each chemical to purchase outside.
Remember that you cannot make or purchase a negative number of chemicals!
Download