The OPTLSO Procedure

Example 3.5 Linear Constraints and a Nonlinear Objective

The problem in this example is to minimize the six-hump camel-back function (Michalewicz 1996, Appendix B). Minimize

\[  f(x) = \left( 4 - 2.1 x_1^2 + \frac{x_1^4}{3} \right) x_1^2 + x_1 x_2 + \left( -4 + 4 x_2^2 \right) x_2^2  \]

subject to

\[  \begin{array}{rcr} 2x_1 + x_2 & \le &  2 \\ x_1 - x_2 & \ge &  -2 \\ x_1 + 2x_2 & \ge &  -2 \end{array}  \]

Providing derivative-free algorithms with good estimates for lower and upper bounds often greatly improves performance because it prevents the algorithm from unnecessarily sampling in regions that you do not want to explore. For this problem, the following statements add the explicit variable bounds $-2 \le x_1 \le 2$ and $-2 \le x_2 \le 2$:

data xbnds;
   input _id_ $ _lb_ _ub_;
   datalines;
x1 -2 2
x2 -2 2
;

data lindata;
   input _id_ $ _lb_ x1 x2 _ub_;
   datalines;
a1   . 2  1 2
a2  -2 1 -1 .
a3  -2 1  2 .
;

data objdata;
   input _id_ $ _function_ $ _sense_ $;
   datalines;
f   sixhump     min
;

proc fcmp outlib=sasuser.myfuncs.mypkg;
   function sixhump(x1,x2);
      return ((4 - 2.1*x1**2 + x1**4/3)*x1**2 + x1*x2 + (-4 + 4*x2**2)*x2**2);
   endsub;
run;

options cmplib = sasuser.myfuncs;
proc optlso
   primalout = solution
   variables = xbnds
   objective = objdata
   lincon    = lindata;
   performance nthreads=2;
run;

proc print data=solution;
run;

Output 3.5.1 shows the output from running these steps.

Output 3.5.1: Linear Constraints and a Nonlinear Objective

The OPTLSO Procedure

Performance Information
Execution Mode Single-Machine
Number of Threads 2

Problem Summary
Problem Type NLP
   
Linear Constraints LINDATA
Objective Definition Set OBJDATA
Variables XBNDS
   
Number of Variables 2
Integer Variables 0
Continuous Variables 2
   
Number of Constraints 3
Linear Constraints 3
Nonlinear Constraints 0
   
Objective Definition Source OBJDATA
Objective Sense Minimize

Solution Summary
Solution Status Function convergence
Objective -1.031628453
Infeasibility 0
Iterations 26
Evaluations 1474
Cached Evaluations 17
Global Searches 1
Population Size 80
Seed 1

Obs _sol_ _id_ _value_
1 0 _obj_ -1.03163
2 0 _inf_ 0.00000
3 0 x1 -0.08983
4 0 x2 0.71265
5 0 f -1.03163