1) Decoction MAX Z = -5 * x1 5 * x2 13 * x3-x1 x2 3 * x3 <= 20 12 * x1 4 * x2 10 * x3 <= 90 x1, X2, X3> = 0 Program: data lp1; input _row_ $ x1 x2 x3 _type_ $ _RHS_; Cards; Object -5 5 13 Max. Proc1 -1 1 3 LE 20 Proc2 12 4 10 LE 90; Proc LP; Run; * X1 = 0 * x2 = 20 * x3 = 0
2) Solution to the LP process to solve the number linear planning MAX 2 * x1 3 * x2 5 * x1 7 * x2 <= 35 4 * x1 9 * x2 <= 36 x1, x2> = 0 x1, x2 is an integer program: Data LP1; Input _Row_ $ x1 x2_type_ $ _RHS_; Cards; Object 2 3 max. Proc1 5 7 Le 35 Proc2 4 9 Le 36 Bound 10 10 Upperbd. Inbd 1 2 Integer.; Proc Lp; Run; x1 = 7 x2 = 0
3) Solve unconstrained optimization with NLP process min z = 1.5 * x1 * x1 0.5 * x2 * x2-x1 * x2 2 * x1 program: proc nlp; min y; pARMS X1 x2 = -1; bounds 0 < = x1, 0 <= x2; y1 = 1.5 * x1 * x1; y2 = 0.5 * x2 * x2; y3 = -1 * x1 * x2; y4 = -2 * x1; y = Y1 Y2 Y3 Y4; Run;
X1 = x2 = 1
4) Solve unconstrained optimization with NLP process MIN Z = -2 * X1-X2 25-x1 * x1-x2 * x2> = 0 7-x1 * x1 x2 * x2> = 0 0 <= x1 <= 5 0 <= x2 <= 10 program: proc NLP; min y; pARMS X1 X2 = -1; bounds 0 <= x1 <= 5, 0 <= x2 <= 10; Y1 = -2 * x1; Y2 = -1 * x2; y3 = 25-x1 * x1-x2 * x2; y4 = 7-x1 * x1 x2 * x2; nlincon y3> = 0, y4> = 0; y = y1 y2 y3 y4; RUN; X1 = 4 x2 = 3 minz = -11
5) Using NLP process to solve nonlinear planning min z = 2 * x1 * x1-4 * x1 * x2 4 * x2 * x2-6 * x1-3 * x2 x1 x2 <= 3 4 * x1 x2 <= 9 x1, x2> = 0 Program: Proc NLP; min y; PARMS X1 X2 = -1; Bounds 0 <= x1, 0 <= x2; y1 = 2 * x1 * x1; Y2 = -4 * x1 * x2; Y3 = 4 * x2 * x2; y4 = -6 * x1-3 * x2; y5 = 4 * x1 x2; y6 = x1 x2; nlincon y5 <= 9, (Note: NLINCON can't have Y5 Y6> 9 The form of Y> C is in the form of Y> C) Y6 <= 3; Y = Y1 Y2 Y3 Y4; Run; x1 = 1.95 x2 = 1.05 minz = -11.0256) Solve the following linear target planning model MIN Z = P1 * D11 P2 * D22 P3 * (5 * D31 3 * D41) P4 * D12 X1 2 * x2 D11-D12 = 6 x1 2 * x2 D21-D22 = 9 x1-2 * x2 D31 -D32 = 4 x2 D41-D42 = 2 x1, x2, dij> = 0, i = 1, 2, 3, 4 j = 1, 2 procedures: data hua; input _row_ $ x1 x2 D11 D12 D21 D22 D31 D32 D41 D42 _Type_ $ _RHS_; Cards; Object 0 0 0.99 0.000061875 0 0.000037125 0 min. (may not be used by other operators, only data) CON1 1 2 1 -1 0 0 0 0 0 0 EQ 6 CON2 1 2 0 0 1 -1 0 0 0 0 EQ 9 Con3 1 -2 0 0 0 0 1 -1 0 EQ 4 CON4 0 1 0 0 0 0 0 1 -1 Eq 2; Proc Lp; Run;
7) Solve the following 0-1 planning model MAX Z = 3 * x1 2 * x2-5 * x3-2 * x4 3 * x5 x1 x2 x3 2 * x4 x5 <= 4 7 * x1 3 * X3-4 * x4 3 * x5 <= 8 11 * x1-6 * x2 3 * x4-3 * x5> = 3 xj = 0 or 1 (j = 1, ..., 5) program: Data Cat ; Input _row_ $ x1-x5 _type_ $ _RHS_; Cards; Object 3 2 -5 -2 3 max. Con1 1 1 1 2 1 Le 4 CON2 7 0 3 -4 3 Le 8 CON3 11-6 0 3 -3 GE 3 Bound 1 1 1 1 1 Upperbd. InBD 1 2 3 4 5 Integer. Proc Lp; Run; Sensitivity Analysis Max Z = 2 * x1 x23 * x1 5 * x2 <=15 0.8@6*x1 2* 22 <= 24 1.9 @ x1, x2> = 0
Program: data rhsen; input _row_ $ x1 x2 _type_ $ _RHS_ CC; cards; object 2 1 max.. Con1 3 5 le 15 0.8 con2 6 2 le 24 1.9; proc LP DATA = rhsen; rhssen cc; run;
The LP process begins with the solution of @ = 0 (x1 * = 3.750 x28 = 0.750) then performs sensitivity analysis, and outputs the right source vector, RHS Sensitivity Analysis Summary, this profile contains: @ = @ min Value, when @ = @ min (ie, from the base variable into non-base variable), @ = @ min value, @ = @ max value and other corresponding value, column of each variable Number (COL), @ = @ min time variable optimal decapbling, @ = @ max, the optimal solution value of the variable. This analysis is indicated that when @ min = -11.3924, the optimal solution is x1 * = 0.0 x2 * = 1.177215. When @ max = 20.0, the optimal solution is x1 * = 10.333 x2 * = 0.0
Max z = (2 1.2 @) * x1 (1 @) * x23 * x1 5 * x2 <= 156 * x1 2 * x2 <= 24x1, x2> = 0
Procedure: Data RHSen; Input _Row_ $ X1 X2_Type_ $ _RHS_; Cards; Object 2 1 max. Con1 3 5 Le 15 CON2 6 2 LE 24 Price 1.2 1 PriceSen. (This point must be added); Proc LP; Run; output RHS Sensitivity Analysis Summary This includes: @min value, when @ = @ min (ie, from non-base variables become a base variable), @ = @ min time target function Value, @ max, when @ = @ max, @ = @ max When the target function value, column number and name of each variable (col, name), @ = @ min value Coefficient (Price) ) And optimal conditions check the number (@ = @ max), the value of the value (Price) and the best condition check (Reduced Cost). The output results show that when @ belongs to (-0.555556, &), the optimal solution is still x1 * = 3.750x2 * = 0.750