The OPTLSO Procedure

Describing Nonlinear Constraints

Nonlinear constraints are treated as black-box functions and are described by using the FCMP procedure. You should use the NLINCON= option to provide PROC OPTLSO with the corresponding FCMP function names and lower and upper bounds. Suppose a problem has the following nonlinear constraints:

\[ \begin{array}{cccccc} -1 \le & x_1 x_2 x_3 + \sin (x_2) & \le 1 \\ & x_1 x_2 + x_1 x_3 + x_2 x_3 & = 1 \end{array} \]

The following statements pass this information to PROC OPTLSO by adding two corresponding functions to the FCMP function library Sasuser.Myfuncs.Mypkg:

proc fcmp outlib=sasuser.myfuncs.mypkg;
   function con1(x1, x2, x3);
      return (x1*x2*x3 + sin(x2));
   endsub;
   function con2(x1, x2, x3);
      return (x1*x2 + x1*x3 + x3*x3);
   endsub;
run;

Next, the following DATA step defines nonlinear constraint names and provides their corresponding bounds in the data set condata:

data condata;
   input _id_ $ _lb_ _ub_;
   datalines;
con1 -1 1
con2  1 1
;

Finally, you can call PROC OPTLSO and specify NLINCON= CONDATA. For another example with nonlinear constraints, see Using Nonlinear Constraints.