The NLP Procedure |
The following optimization problem is discussed in Haverly (1978) and in Liebman et al. (1986, pp. 127--128). Two liquid chemicals, and , are produced by the pooling and blending of three input liquid chemicals, , , and . You know the sulfur impurity amounts of the input chemicals, and you have to respect upper limits of the sulfur impurity amounts of the output chemicals. The sulfur concentrations and the prices of the input and output chemicals are:
You know customers will buy no more than 100 units of X and 200 units of Y. The problem is determining how to operate the pooling and blending of the chemicals to maximize the profit. The objective function for the profit is
There are three groups of constraints:
There exist several local optima to this problem that can be found by specifying different starting points. Using the starting point with all variables equal to 1 (specified with a PARMS statement), PROC NLP finds a solution with :
proc nlp all; parms amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy pools = 1; bounds 0 <= amountx amounty amounta amountb amountc, amountx <= 100, amounty <= 200, 0 <= pooltox pooltoy ctox ctoy, 1 <= pools <= 3; lincon amounta + amountb = pooltox + pooltoy, pooltox + ctox = amountx, pooltoy + ctoy = amounty, ctox + ctoy = amountc; nlincon nlc1-nlc2 >= 0., nlc3 = 0.; max f; costa = 6; costb = 16; costc = 10; costx = 9; costy = 15; f = costx * amountx + costy * amounty - costa * amounta - costb * amountb - costc * amountc; nlc1 = 2.5 * amountx - pools * pooltox - 2. * ctox; nlc2 = 1.5 * amounty - pools * pooltoy - 2. * ctoy; nlc3 = 3 * amounta + amountb - pools * (amounta + amountb); run;
The specified starting point was not feasible with respect to the linear equality constraints; therefore, a starting point is generated that satisfies linear and boundary constraints. Output 4.7.1 gives the starting parameter estimates.
Output 4.7.1: Starting EstimatesThe starting point satisfies the four equality constraints, as shown in Output 4.7.2. The nonlinear constraints are given in Output 4.7.3.
Output 4.7.2: Linear Constraints
|
Output 4.7.4 shows the settings of some important PROC NLP options.
Output 4.7.4: OptionsPROC NLP: Nonlinear Maximization
|
The iteration history, given in Output 4.7.5, does not show any problems.
Output 4.7.5: Iteration HistoryPROC NLP: Nonlinear Maximization
Dual Quasi-Newton Optimization
Modified VMCWD Algorithm of Powell (1978, 1982)
Dual Broyden - Fletcher - Goldfarb - Shanno Update (DBFGS)
Lagrange Multiplier Update of Powell(1982)
|
The optimal solution in Output 4.7.6 shows that to obtain the maximum profit of $400, you need only to produce the maximum 200 units of blending and no units of blending .
Output 4.7.6: Optimization SolutionPROC NLP: Nonlinear Maximization
Value of Objective Function = 400
Value of Lagrange Function = 400
|
The constraints are satisfied at the solution, as shown in Output 4.7.7
Output 4.7.7: Linear and Nonlinear Constraints at the Solution
|
The same problem can be specified in many different ways. For example, the following specification uses an INEST= data set containing the values of the starting point and of the constants COST, COSTB, COSTC, COSTX, COSTY, CA, CB, CC, and CD:
data init1(type=est); input _type_ $ amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy pools _rhs_ costa costb costc costx costy ca cb cc cd; datalines; parms 1 1 1 1 1 1 1 1 1 1 . 6 16 10 9 15 2.5 1.5 2. 3. ;
proc nlp inest=init1 all; parms amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy pools; bounds 0 <= amountx amounty amounta amountb amountc, amountx <= 100, amounty <= 200, 0 <= pooltox pooltoy ctox ctoy, 1 <= pools <= 3; lincon amounta + amountb = pooltox + pooltoy, pooltox + ctox = amountx, pooltoy + ctoy = amounty, ctox + ctoy = amountc; nlincon nlc1-nlc2 >= 0., nlc3 = 0.; max f; f = costx * amountx + costy * amounty - costa * amounta - costb * amountb - costc * amountc; nlc1 = ca * amountx - pools * pooltox - cc * ctox; nlc2 = cb * amounty - pools * pooltoy - cc * ctoy; nlc3 = cd * amounta + amountb - pools * (amounta + amountb); run;
The third specification uses an INEST= data set containing
the boundary and linear constraints in addition to the values
of the starting point and of the constants. This specification
also writes the model specification into an OUTMOD= data set:
data init2(type=est); input _type_ $ amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy pools _rhs_ costa costb costc costx costy; datalines; parms 1 1 1 1 1 1 1 1 1 1 . 6 16 10 9 15 2.5 1.5 2 3 lowerbd 0 0 0 0 0 0 0 0 0 1 . . . . . . . . . . upperbd 100 200 . . . . . . . 3 . . . . . . . . . . eq . . 1 1 . -1 -1 . . . 0 . . . . . . . . . eq 1 . . . . -1 . -1 . . 0 . . . . . . . . . eq . 1 . . . . -1 . -1 . 0 . . . . . . . . . eq . . . . 1 . . -1 -1 . 0 . . . . . . . . . ;
proc nlp inest=init2 outmod=model all; parms amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy pools; nlincon nlc1-nlc2 >= 0., nlc3 = 0.; max f; f = costx * amountx + costy * amounty - costa * amounta - costb * amountb - costc * amountc; nlc1 = 2.5 * amountx - pools * pooltox - 2. * ctox; nlc2 = 1.5 * amounty - pools * pooltoy - 2. * ctoy; nlc3 = 3 * amounta + amountb - pools * (amounta + amountb); run;
The fourth specification not only reads the INEST=INIT2 data set, it also uses the model specification from the MODEL data set that was generated in the last specification. The PROC NLP call now contains only the defining variable statements:
proc nlp inest=init2 model=model all; parms amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy pools; nlincon nlc1-nlc2 >= 0., nlc3 = 0.; max f; run;
All four specifications start with the same starting point of all variables equal to 1 and generate the same results. However, there exist several local optima to this problem, as is pointed out in Liebman et al. (1986, p. 130).
proc nlp inest=init2 model=model all; parms amountx amounty amounta amountb amountc pooltox pooltoy ctox ctoy = 0, pools = 2; nlincon nlc1-nlc2 >= 0., nlc3 = 0.; max f; run;
This starting point with all variables equal to 0 is accepted as a local solution with , which minimizes rather than maximizes the profit.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.