Sunteți pe pagina 1din 6

Simplex Method

In this example you will be solving a linear programming problem using the simplex method. After working through this
example, try to work some of the exercises from the book.

The example is found on Sheet 2. You can get there by clicking on the tab labeled "sheet 2" at the bottom left of the Excel
screen.

functions necessary for this exercise: none


d. After working through this

2" at the bottom left of the Excel


Since we can use Excel to solve systems of equations and
evaluate formulas, we can use it to solve linear programming
problems. Let's work through the beginning example from Section
8.2 that is then completed in 8.3..

The constraints are


1) 6x + 5y < 40
2) 200x + 100y < 1000
3) x > 0
4) y > 0

The objective is
z = 240x + 160y

We now rewrite the constraints and objective using new variables.

The constraints are


1) 6x1 + 5x2 < 40
2) 200x1 + 100x2 < 1000
3) x1 > 0
4) x2 > 0

The objective is
z = 240x1 + 160x2

Convert the constraint inequalities to equations.


1) 6x1 + 5x2 + s1 = 40
2) 200x1 + 100x2 + s2 = 1000
3) x1 > 0 As noted in the book, we don't bother adjusting 3) or 4).
4) x2 > 0

Rewrite the objective with all variables on the left side.


-240x1 - 160x2 + z = 0
or, using all the variables
-240x1 - 160x2 + 0s1 + 0s2 + z = 0

We now have three equations.


1) 6x1 + 5x2 + s1 = 40
2) 200x1 + 100x2 + s2 = 1000
3) -240x1 - 160x2 + 0s1 + 0s2 + z = 0

Set it up in a matrix.
x1 x2 s1 s2 z solution
6 5 1 0 0 40
200 100 0 1 0 1000
-240 -160 0 0 1 0

As explained in the book, we have a solution if x1 = x2 = 0, s1 = 40, s2 = 1000 and z = 0. Obviously,


however, this does not give a maximum profit. But we have found the corner point, P1 (where (x1,
x2) = (0, 0)) from the graph.
As described in 8.3, we will do row reduction (pivot) on the second row first.

6 5 1 0 0 40
1 0.5 0 0.005 0 5 simplify by multiplying by 1/200
-240 -160 0 0 1 0

0 2 1 -0.03 0 10 elimination
1 0.5 0 0.005 0 5
0 -40 0 1.2 1 1200 elimination

Again, as noted in the book, we have a solution if s2 = x2 = 0, x1 = 5, s1 = 10 and z = 1200. We


have found another corner point, P4 (where (x1, x2) = (5, 0)) from the graph.

As described in 8.3, we will now pivot on the first row.

0 1 0.5 -0.015 0 5 simplify by multiplying by 1/2


1 0.5 0 0.005 0 5
0 -40 0 1.2 1 1200

0 1 0.5 -0.015 0 5 elimination


1 0 -0.25 0.0125 0 2.5
0 0 20 0.6 1 1400 elimination

Again, as noted in the book, we have a solution if s1 = s2 = 0, x1 = 2.5, x2 = 5 and z = 1400. We


have found another corner point, P3 (where (x1, x2) = (2.5, 5)) from the graph.

No further pivoting possible means one of the points we found must give the maximum. The choices
are z = 0, 1200 or 1400. Obviously the answer is 1400 so x1 = 2.5 and x2 = 5.
y multiplying by 1/200

y multiplying by 1/2

S-ar putea să vă placă și