The OPTLP Procedure |
Consider an oil refinery scenario. A step in refining crude oil into finished oil products involves a distillation process that splits crude into various streams. Suppose there are three types of crude available: Arabian light (a_l), Arabian heavy (a_h), and Brega (br). These crudes are distilled into light naphtha (na_l), intermediate naphtha (na_i), and heating oil (h_o). These in turn are blended into two types of jet fuel. Jet fuel j_1 is made up of 30% intermediate naphtha and 70% heating oil, and jet fuel j_2 is made up of 20% light naphtha and 80% heating oil. What amounts of the three crudes maximize the profit from producing jet fuel (j_1, j_2)? This problem can be formulated as the following linear program:
The constraints "blend1" and "blend2" ensure that j_1 and j_2 are made with the specified amounts of na_i and na_l, respectively. The constraint "blend3" is actually the reduced form of the following constraints:
where h_o1 and h_o2 are dummy variables.
You can use the following SAS code to create the input data set ex1:
data ex1; input field1 $ field2 $ field3$ field4 field5 $ field6 ; datalines; NAME . EX1 . . . ROWS . . . . . N profit . . . . E napha_l . . . . E napha_i . . . . E htg_oil . . . . L blend1 . . . . L blend2 . . . . L blend3 . . . . COLUMNS . . . . . . a_l profit -175 napha_l .035 . a_l napha_i .100 htg_oil .390 . a_h profit -165 napha_l .030 . a_h napha_i .075 htg_oil .300 . br profit -205 napha_l .045 . br napha_i .135 htg_oil .430 . na_l napha_l -1 blend2 -1 . na_i napha_i -1 blend1 -1 . h_o htg_oil -1 blend3 -1 . j_1 profit 350 blend1 .3 . j_1 blend3 .7 . . . j_2 profit 350 blend2 .2 . j_2 blend3 .8 . . BOUNDS . . . . . UP . a_l 110 . . UP . a_h 165 . . UP . br 80 . . ENDATA . . . . . ;
You can use the following call to PROC OPTLP to solve the LP problem:
proc optlp data=ex1 objsense = max solver = primal primalout = ex1pout dualout = ex1dout printfreq = 1; run; %put &_OROPTLP_;
Note that the OBJSENSE=MAX option is used to indicate that the objective function is to be maximized.
The primal and dual solutions are displayed in Output 15.1.1.
Output 15.1.1: Example 1: Primal and Dual Solution OutputThe progress of the solution is printed to the log as follows.
Output 15.1.2: Log: Solution Progress
|
Note that the %put statement immediately after the OPTLP procedure prints value of the macro variable _OROPTLP_ to the log as follows.
Output 15.1.3: Log: Value of the Macro Variable _OROPTLP_The value briefly summarizes the status of the OPTLP procedure upon termination.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.