Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Suranaree
UNIVERSITY OF TECHNOLOGY NAKORNRATCHSIMA
where aij = amount of ith resource used by jth activity bi = amount of ith resource available
Example: Setting Up the Linear Programming Problem Producing product with limited resources: Gas processing plant Product Resource Raw gas Production time Storage Profit Set Regular 7 m3/ton 10 hr/ton 9 ton 150 / ton Premium 11 m3/ton 8 hr/ton 6 ton 175 / ton Resource Availability 77 m3/week 80 hr/week
Maximize Z = 150x1 + 175x2 Objective function Total gas used = 7x1 + 11x2 cannot exceed 77 m3/week 7x1 + 11x2 10x1 + 8x2 x1 9 x2 0 77 80 6 Constraints
x1 , x2
Graphical Solution x2
7x1+11x2
77 x1 9 11
0 Z=0 Z = 600
x1
x1
No Feasible Solution x2
x1
Unbounded Problems x2
x1
Simplex Method Assumption: optimal solution will be an extreme point x2 Extreme points: corner points where two constraints meet Z = 1400 Objective function is LINEAR
Z=0
Z = 600
x1
7 x1 + 11x2 77 7 x1 + 11x2 + S1 = 77
Resource constraint How much slack of the resource is available ?
IF . . . S1 = + Surplus resource is not fully used. S1 = - Exceeded the constraint. S1 = 0 Exactly meet the constraint. All resource is used.
x1 , x2 , S1 , S 2 , S3 , S4
Algebraic Solution
Underspecified : more unknowns (6) than equations (4) x2
10x1 + 8x2 = 80 S2 = 0 x1 = 9, S3 = 0 Extreme Point Zero Variables
x2 = 6, S4 = 0
E D C
7x1 + 11x2 = 77 S1 = 0
A B C D E
A 0
B 9 x1
nonbasic variables
7 x1 + 11x2 + S1 0 10 x1 + 8 x2 + S2 0 x1 + S3 0 x2 + S4
= 77 = 80 =9 =6
11x2 + S1 8 x2 + S2 S3 x2
= 77 = 80 =9 =6
S1 S2 S3 S4
= 77 = 80 = 9 = 6
Tableau: Z - 150x1 - 175x2 - 0S1 - 0S2 - 0S3 - 0S4 = 0 Basic Z S1 S2 S3 S4 Z x1 x2 S1 0 1 0 0 0 S2 0 0 1 0 0 S3 0 0 0 1 0 S4 Solution Intercept 0 0 0 0 1 0 77 80 9 6 11 8 9
1 -150 -175 0 7 11 0 10 8 0 1 0 0 0 1
Graphical Depiction of Simplex Method x2 S2 6 E D C S1 A 0 B 8 F 11 x1 S4 S3 Change x1 to basic variable (entering variable) Move from A horizontally Check intercept: Intercept = Solution (for each S) x1 coeff. S2 give min. intercept = 8
7 x1 + S1 10 x1 x1
+ S3 S4
= = = =
77 80 9 6
Pivot row S2: Dividing row by 10 and replacing S2 by x1 Basic Z S1 x1 S3 S4 Z Z x1 x2 S1 0 1 0 0 0 0 S2 0 0 0.1 0 0 S3 0 0 0 1 0 S4 Solution 0 0 0 0 1 0 0 77 8 9 6 1200 x -150 1 -150 -175 0 7 11 0 1 0.8 0 1 0 0 0 1 1 0 -55
15 0
Perform same operation on the remaining rows, Basic Z S1 x1 S3 S4 Z 1 0 0 0 0 x1 x2 S1 S2 S3 0 0 0 1 0 S4 Solution Intercept 0 0 0 0 1 1200 21 8 1 6 3.889 10 -1.25 6
- From A to B, objective function has increased to 1200 - S1 give min. positive intercept = 3.889 is entering variable - Move from B to C
10.19 7.87 0.19 -0.13 -0.15 0.20 0.15 -0.20 -0.19 0.13
- No negative coeff. in objective func. row, No more increasing. Final solution: x1 = 3.89, x2 = 4.89 Z = 1414
x1 x2 x1 x2 1.5 x1 x2 10
x1 x2 x1 x2 + 1.5 0 x1 x2 10 0
Write M-file confun.m for the constraints function [c, ceq] = confun(x) % nonlinear inequality constraints c = [1.5 + x(1)*x(2) - x(1) - x(2); -x(1)*x(2) - 10]; % nonlinear equality constraints ceq = [];
> x0 = [-1,1]; > options = optimset(LargeScale,off); > [x, fval] = . . . fmincon(objfun,x0,[],[],[],[],[],[],confun,options) x = -9.5474 fval = 0.0236
1.0474