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 variables = xbnds objective = objdata lincon = lindata; performance nthreads=2; 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 |
Parallel Mode | Deterministic |
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.031628449 |
Infeasibility | 0 |
Iterations | 32 |
Evaluations | 1802 |
Cached Evaluations | 411 |
Global Searches | 1 |
Population Size | 80 |
Seed | 1 |