Solving with Lindo
Min |
|
|
|
P1Y1+ |
+ P2Y2- |
|
+ P3Y3- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s.t. |
|
|
|
|
|
|
|
|
|
|
|
10 L |
+ 15 E |
|
|
|
|
|
|
≤ 70 |
(Labour) |
|
L |
– E |
|
|
|
|
|
|
≥ 0 |
(Production) |
Goal 1: |
10 L |
+ 15 E |
+ Y1- |
– Y1+ |
|
|
|
|
= 40 |
(Overtime) |
Goal 2: |
100 L |
+ 100 E |
|
|
+ Y2- |
– Y2+ |
|
|
= 1000 |
(Profit) |
Goal 3: |
|
E |
|
|
|
|
+ Y3- |
– Y3+ |
= 7 |
(Enamel Prod.) |
|
|
|
All variables ≥ 0 |
|
|
|
|
Using this same problem we will solve it with Lindo.
I will rewrite the problem using y1...y6 variables because it is easier to type the problem in Lindo with that notation without getting confused with the + and - signs.
Therefore the new problem is
min P1Y2 + P2Y3 + P3Y5
s.t.
10 L + 15 E <= 70 (Labour)
L - E >= 0 (Production)
10 L + 15 E + Y1 - Y2 = 40 (Overtime - Goal 1)
100 L + 100 E + Y3 - Y4 = 1000 (Profit - Goal 2)
E + Y5 + Y6 = 7 (Enamel Production)
All variables >= 0
To solve with Lindo, we must minimize one variable at a time in the objective function. So, we will first minimize Y2.
We will write in Lindo the following problem.
min Y2
s.t.
10L + 15 E <= 70
L - E >= 0
10L + 15 E + Y1 - Y2 = 40
100L + 100 E + Y3 - Y4 = 1000
E + Y5 - Y6 = 7
and press solve.
If Goal 1 is achieved, then Y2 = 0. You will get the following printout:
LP OPTIMUM FOUND AT STEP 0
OBJECTIVE FUNCTION VALUE
1) 0.0000000E+00
VARIABLE VALUE REDUCED COST
Y2 0.000000 1.000000
L 0.000000 0.000000
E 0.000000 0.000000
Y1 40.000000 0.000000
Y3 1000.000000 0.000000
Y4 0.000000 0.000000
Y5 7.000000 0.000000
Y6 0.000000 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 70.000000 0.000000
3) 0.000000 0.000000
4) 0.000000 0.000000
5) 0.000000 0.000000
6) 0.000000 0.000000
NO. ITERATIONS= 0
You will note the objective function is 0, and the values of L and E = 0.
To solve for the second goal, we add Y2 = 0, to the constraints as follows and this time we are minimizing Y3, the second variable in the objective function:
min Y3
s.t.
10L + 15 E <= 70
L - E >= 0
10L + 15 E + Y1 - Y2 = 40
100L + 100 E + Y3 - Y4 = 1000
E + Y5 - y6 = 7
Y2 = 0
By putting Y2 =0, we are ensured that the first goal is met. By solving we will get a print out as follows:
LP OPTIMUM FOUND AT STEP 2
OBJECTIVE FUNCTION VALUE
1) 600.0000
VARIABLE VALUE REDUCED COST
Y3 600.000000 0.000000
L 4.000000 0.000000
E 0.000000 50.000000
Y1 0.000000 10.000000
Y2 0.000000 0.000000
Y4 0.000000 1.000000
Y5 7.000000 0.000000
Y6 0.000000 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 30.000000 0.000000
3) 4.000000 0.000000
4) 0.000000 10.000000
5) 0.000000 -1.000000
6) 0.000000 0.000000
7) 0.000000 10.000000
NO. ITERATIONS= 2
You will note the at the objective function is 600, that means Y3 = 600, or we have a slack of 600. This means Goal 2 was not met. We have the L=4 and E=0. We will not attempt to try and meet Goal 3 using Lindo, since if Goal 2 was not met, and we try to meet Goal 3, we will move away from the current optimal solution that makes Goal 2 come as close as possible to its required amount. Remember Goal 2 is more important than Goal 3.
next: Deviation from goal