The problem in this example is to minimize the six-hump camel-back function (Michalewicz 1996, Appendix B). Minimize
subject to
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 and :
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
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 | 1431 |
Cached Evaluations | 60 |
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 |